Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error: TypeError: Cannot read properties of null (reading 'useState') #1653

Open
6 tasks done
ADTC opened this issue Jan 31, 2024 · 0 comments
Open
6 tasks done

Comments

@ADTC
Copy link
Contributor

ADTC commented Jan 31, 2024

Checklist

Description

I'm randomly getting the following error on server.

  Internal error: TypeError: Cannot read properties of null (reading 'useState')
    at t.useState (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:163696)
    at exports.default (./node_modules/@auth0/nextjs-auth0/dist/client/use-user.js:82:52)
    at as (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:6391)
    at /Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:11242
    at aw (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:13009)
    at aw (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:43309)
    at ak (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:46552)
    at ak (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:46847)
    at /Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:55430
    at /Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:56107
    at aD (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:56115)
    at Timeout._onTimeout (/Users/user/project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:4293)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

Note, due to the random nature of the error, it may not be possible to reproduce this in the sample project. Let me know if it's required. I'll try.

Reproduction

  1. Open a Next.js 14 App Router project.
  2. Run the project in dev mode.
  3. Make changes so the page in browser will reload.
  4. Watch out for the error which may or may not occur.

Additional context

This occurs as part of a larger set of errors and warnings. Please see the full set in the Gist here. I don't know if #1614 is related to this or not.

nextjs-auth0 version

3.5.0

Next.js version

14.1.0

Node.js version

20.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant