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

Error [TypeError]: Cannot read properties of undefined (reading 'substring') #70109

Closed
mrjaiswal122 opened this issue Sep 14, 2024 · 2 comments
Closed
Labels
bug Issue was opened via the bug report template. locked Middleware Related to Next.js Middleware. please simplify reproduction The reproduction is too complex

Comments

@mrjaiswal122
Copy link

Link to the code that reproduces this issue

https://github.com/mrjaiswal122/Dossier

To Reproduce

  • provide mongodb uri in env
  • provided google id and secret
  • then run the server
 npm run dev

then go to /auth route

Current vs. Expected behavior

doing so this error will be produced "Error [TypeError]: Cannot read properties of undefined (reading 'substring')" instead it should redirect me to home route if user is logedin or do nothing if user is not not logged in but it's showing this error

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 8093
  Available CPU cores: 4
Binaries:
  Node: 20.15.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.5 // There is a newer version (14.2.11) available, upgrade recommended!
  eslint-config-next: 14.2.5
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.4
Next.js Config:
  output: N/A
 ⚠ There is a newer version (14.2.11) available, upgrade recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a 
new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Which area(s) are affected? (Select all that apply)

Middleware

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

@mrjaiswal122 mrjaiswal122 added the bug Issue was opened via the bug report template. label Sep 14, 2024
@github-actions github-actions bot added the Middleware Related to Next.js Middleware. label Sep 14, 2024
@samcx samcx added the please simplify reproduction The reproduction is too complex label Sep 16, 2024
Copy link
Contributor

We cannot easily recreate the issue with the provided information. Please add a minimal reproduction in order for us to be able to help more efficiently.

Why was this issue marked with the please simplify reproduction label?

There was a reproduction provided, but due to its complexity, we cannot easily reproduce the issue.

An ideal minimal reproduction (unless relevant):

  • is not part of a monorepo
  • does not require secrets to run
  • does not reference private registry dependencies
  • has as few dependencies as possible
  • excludes unrelated pages/routes
  • does not require a database/third-party service to run
  • only includes the code necessary to reproduce the issue
  • is tested against next@canary to make sure your issue has not already been fixed

In general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.

If you cannot create a clean reproduction, another way you can help the maintainers' job is to pinpoint the canary version of next that introduced the issue. Check out our releases, and try to find the first canary release that introduced the issue. This will help us narrow down the scope of the issue, and possibly point to the PR/code change that introduced it. You can install a specific version of next by running npm install next@<version>.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the please simplify reproduction label that receive no meaningful activity (e.g. new comments with a simplified reproduction link) are automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Providing a minimal reproduction from the start without asking helps us look into issues much more quickly, as we can easily verify if the reported bug is related to Next.js. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

@samcx samcx closed this as completed Sep 16, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Oct 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked Middleware Related to Next.js Middleware. please simplify reproduction The reproduction is too complex
Projects
None yet
Development

No branches or pull requests

2 participants