Hey guys, I'm trying to use supertokens with next.js 13, but i get an error when trying Step 2.3 of the Next.js Integration guide:
Unhandled 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)