So I'm getting this error when calling `SuperTokens.init`: Please provide a valid URL path This is...
i
So I'm getting this error when calling `SuperTokens.init`: > Please provide a valid URL path This is my config
Copy code
ts
SuperTokens.init({
  supertokens: {
    connectionURI: "http://127.0.0.1:3567",
  },
  appInfo: {
    appName: "SuperTokens Testing",
    websiteDomain: "http://localhost:3000",
    apiDomain: "http://localhost:3000",
    apiBasePath: "/auth",
  },
  recipeList: [
    EmailPassword.init(),
    Session.init(),
  ],
});
Any idea why I'd be getting this error? Seems like the URLs I have are valid.
r
Hey. If you replace the connection uri with https://try.supertokens.com, does the error go away?
i
No. I tried that too. πŸ˜… I also tried deleting everything and gradually adding options. First I was asked to provide
apiDomain
, then I was asked to provide
websiteDomain
, then I got this error.
r
Can you also provide websiteBasePath such that it’s different from apiBasePath?
Cause both, the websiteDomain and apiDomain are the same
i
Copy code
ts
appInfo: {
    appName: "Testing Next.js with Custom Backend",

    websiteDomain: "http://localhost:3000",
    websiteBasePath: "/auth",

    apiDomain: "http://localhost:3000",
    apiBasePath: "/api/auth",
  }
Still same error, sadly.
r
This is very, very strange
i
Yeah it's odd. I never had this happen in Remix or in Svelte Kit. But it is happening in my Next.js
middleware.ts
file.
r
I have never had this happen in anything πŸ˜…
i
Fantastic. πŸ˜‚
r
πŸ˜‚
i
Well, I'll continue exploring. I'm assuming it's something with Next.js but I have no idea what it would be.
r
Try out our demo apps
And see what the differences are between your app and our demo app
i
Sounds good πŸ‘πŸΏ
It seems
next@13
can't handle
supertokens-node@14
. It specifically has to be
supertokens-node@https://github.com/supertokens/supertokens-node#edge_func_compatibility
, like it is in your demo. Is this a new version of
supertokens-node
that will be coming out later? What's this version doing that's different? And why are Svelte Kit + Remix + Solid able to handle
supertokens-node@14
but not Next.js?
r
We will be releasing a new version soon for edge compatibility
But our current SDK should work with pages dir with next 13. Cause our demo apps work with that
i
Interesting. I'd be curious to know what causes the difference between the app directory and the pages directory. Good to know. I'm probably going to keep testing with the URL version of
supertokens-node
so I can work with what Next.js is doing in the app dir. Odd to run into that issue though. I still like Remix more than Next πŸ˜…
65 Views