# "issuerBaseURL" must be a valid uri

**URL:** <https://community.auth0.com/t/issuerbaseurl-must-be-a-valid-uri/69314>\
**Category:** Get Help\
**Tags:** nextjs\
**Created:** [September 8, 2021, 4:41pm UTC](https://community.auth0.com/t/issuerbaseurl-must-be-a-valid-uri/69314 "2021-09-08T16:41:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amigo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/amigo/32/14328_2.png) [@amigo](https://community.auth0.com/u/amigo)\
**Post date:** [September 8, 2021, 4:41pm UTC](https://community.auth0.com/t/issuerbaseurl-must-be-a-valid-uri/69314/1 "2021-09-08T16:41:40Z")

</div>

I’m getting the error `"issuerBaseURL" must be a valid uri` when using the `nextjs-auth0` SDK in production (but not in dev).

I have AUTH0\_ISSUER\_BASE\_URL in my env variables and it has the format `https://<MY_DOMAIN>.auth0.com`.

Here is the full error:

```auto
TypeError: "issuerBaseURL" must be a valid uri
    at Object.get (/app/node_modules/@auth0/nextjs-auth0/dist/auth0-session/get-config.js:147:15)
    at Object.getConfig (/app/node_modules/@auth0/nextjs-auth0/dist/config.js:66:38)
    at Object.initAuth0 (/app/node_modules/@auth0/nextjs-auth0/dist/index.js:22:23)
    at getInstance (/app/node_modules/@auth0/nextjs-auth0/dist/index.js:18:24)
    at handleAuth (/app/node_modules/@auth0/nextjs-auth0/dist/index.js:124:18)
    at Object.4987 (/app/.next/server/pages/api/auth/[...auth0].js:15:127)
    at __webpack_require__ (/app/.next/server/webpack-runtime.js:25:42)
    at __webpack_exec__ (/app/.next/server/pages/api/auth/[...auth0].js:49:52)
    at /app/.next/server/pages/api/auth/[...auth0].js:50:28
    at Object.<anonymous> (/app/.next/server/pages/api/auth/[...auth0].js:53:3)

```

And here is my `[..auth0.js]` file:

```auto
import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

export default handleAuth({
    async login(req, res) {
      try {
        await handleLogin(req, res, {
          authorizationParams: {
            audience: process.env.AUTH0_AUDIENCE,
            // Add the `offline_access` scope to also get a Refresh Token
            scope: 'openid profile email'
          }
        });
      } catch (error) {
        res.status(error.status || 400).end(error.message);
      }
    }
  });

```

Any thoughts on what I’m doing wrong here?

I’m using:  
Next.js v11.0.1  
nextjs-auth0 v.1.5.0

Thank you in advance

---

<div class="post-metadata">

**Author:** ![chris-timworks](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris-timworks/32/31039_2.png) [@chris-timworks](https://community.auth0.com/u/chris-timworks)\
**Post date:** [November 9, 2021, 10:24am UTC](https://community.auth0.com/t/issuerbaseurl-must-be-a-valid-uri/69314/2 "2021-11-09T10:24:42Z")

</div>

I had the same issue and removed the " from the env variable and that worked for me

I’m using:  
nextjs-auth0 ^1.4.2  
next 12.0.3

I hope it helps

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 9, 2021, 11:52am UTC](https://community.auth0.com/t/issuerbaseurl-must-be-a-valid-uri/69314/3 "2021-11-09T11:52:37Z")

</div>

Thanks for sharing that with the rest of community Chris!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 24, 2021, 11:53am UTC](https://community.auth0.com/t/issuerbaseurl-must-be-a-valid-uri/69314/4 "2021-11-24T11:53:14Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
