Deleted User
01/06/2023, 3:27 AMUnhandled Runtime Error
Error: SuperTokens must be initialized before calling this method.
------------------------------------------------------------------
pages/auth/[[...path]].tsx (15:8) @ eval
13 | // if the user visits a page that is not handled by us (like /auth/random), then we redirect them back to the auth page.
14 | useEffect(() => {
> 15 | if (SuperTokens.canHandleRoute() === false) {
| ^
16 | redirectToAuth()
17 | }
18 | }, [])
. Any ideas? I presume the SuperTokensReact.init(frontendConfig())
in _app.tsx
(although I added this in context-providers.tsx
which is basically the same thing) is meant to initialize, but it doesn't seem to. (context-providers.tsx
has 'use client'
up the top, not sure if important)rp_st
01/06/2023, 4:18 AMrp_st
01/06/2023, 4:19 AMsemagraph
01/06/2023, 5:01 AMsemagraph
01/06/2023, 5:02 AMapp
structure for Next.js 13?semagraph
01/06/2023, 5:03 AMsemagraph
01/06/2023, 5:06 AMsemagraph
01/06/2023, 5:08 AMts
if (typeof window !== 'undefined') {
SuperTokensReact.init(frontendConfig())
}
semagraph
01/06/2023, 5:09 AMpages/_app.tsx
file, although supertokens maybe can't recognize it?rp_st
01/06/2023, 5:26 AMsemagraph
01/06/2023, 5:26 AMrp_st
01/06/2023, 5:26 AMsemagraph
01/06/2023, 5:29 AMSuperTokensReact.init(..)
?rp_st
01/06/2023, 5:29 AMsemagraph
01/06/2023, 5:30 AMrp_st
01/06/2023, 5:31 AMsemagraph
01/06/2023, 5:31 AMrp_st
01/06/2023, 5:32 AMsemagraph
01/06/2023, 5:32 AM/
or at /auth
?rp_st
01/06/2023, 5:33 AMsemagraph
01/06/2023, 5:33 AM/
does show the console.log output, /auth
does notrp_st
01/06/2023, 5:33 AMsemagraph
01/06/2023, 5:34 AM/
does show an updated warn
message in the next logsemagraph
01/06/2023, 5:34 AMsemagraph
01/06/2023, 5:34 AM/auth
does not thoughsemagraph
01/06/2023, 5:35 AM/config/**
files important here?rp_st
01/06/2023, 5:36 AMrp_st
01/06/2023, 5:36 AMsemagraph
01/06/2023, 5:36 AMnpx create-supertokens-app@latest --frontend=next --recipe=thirdpartyemailpassword
rp_st
01/06/2023, 5:37 AMsemagraph
01/06/2023, 5:37 AMapp
structure though? didn't see that directory in theresemagraph
01/06/2023, 5:39 AMapp/
semagraph
01/06/2023, 5:40 AMsemagraph
01/06/2023, 5:41 AMrp_st
01/06/2023, 5:54 AMsemagraph
01/06/2023, 5:55 AM