Skip to content

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

Closed
@ADTC

Description

@ADTC

Checklist

  • The issue can be reproduced in the nextjs-auth0 sample app (or N/A).
    I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
    I have looked into the API documentation and have not found a suitable solution or answer.
    I have searched the issues and have not found a suitable solution or answer.
    I have searched the Auth0 Community forums and have not found a suitable solution or answer.
    I agree to the terms within the Auth0 Code of Conduct.

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

Activity

tusharpandey13

tusharpandey13 commented on Feb 14, 2025

@tusharpandey13
Contributor

Closing this since this issue is not relevant to the latest version of our SDK, V4. Please open a seperate issue if it is present in V4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ADTC@tusharpandey13

        Issue actions

          Internal error: TypeError: Cannot read properties of null (reading 'useState') · Issue #1653 · auth0/nextjs-auth0