Closed wongk closed 6 months ago
Auth0-React is a client-side (SPA) SDK that relies on the window. If you integrate it in NextJS, it's important to ensure it does not fail on the server-side. I understand NextJS has gone through a set of changes, and there may be issues with the blog post.
Can you reproduce the behavior in our nextjs example here: https://github.com/auth0/auth0-react/tree/main/examples/nextjs-app ? If so, would u be able to create a fork, or share the changes needed to make it break?
My apologies. Based on when this error started happening, I made an assumption about what was causing it that was incorrect. Once I saw the example app was working, I knew it had to be something else. Problem resolved.
Checklist
Description
We have a Next.js app, and I am attempting to integrate Auth0 using the static site approach as outlined here: https://auth0.com/blog/ultimate-guide-nextjs-authentication-auth0/.
After adding the
Auth0Provider
to the _app file, we get the following error:This error occurs whether we use an app subclass, extending
App
fromnext/app
, or whether we use the functional approach. We do not get this error when wrapping individual pages.Reproduction
Following the steps as indicated in the linked blog post.
Additional context
No response
auth0-react version
2.2.4
React version
18.2.0
Which browsers have you tested in?
Chrome