error TypeError: Cannot read properties of undefined (reading '') when using Next.js runtime edge on turborepo or Nx
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 13.4.13-canary.13
eslint-config-next: 13.4.1
react: 18.2.0
react-dom: 18.2.0
typescript: 4.9.5
Next.js Config:
output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/NastykSwED/turbo-next-edge
To Reproduce
- Run pnpm install to install the dependencies.
- Run pnpm dev to get both projects up or run pnpm dev --filter [docs | web].
- Go to http://localhost:3001/ or http://localhost:3000/ and see the console for the following error:
And in the browser:
Describe the Bug
When using the runtime edge on a monorepo such as turborepo or Nx, the console throws the error: "- error TypeError: Cannot read properties of undefined (reading '')". This only happens with monorepos, when using standalone applications this does not happen.
Expected Behavior
It should not throw the above error when using a Nextjs app with the runtime edge on a monorepo.
Which browser are you using? (if relevant)
Microsoft Edge Versión 115.0.1901.188 (Compilación oficial) (64 bits)
How are you deploying your application? (if relevant)
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked turbo-next-edge reproduction and run pnpm install followed by pnpm dev, or pnpm dev --filter docs or web. Compare the monorepo behavior with a standalone Next.js app using the edge runtime, focusing on the App Router and Middleware / Edge areas named in the report. Done means the reproduced applications start without the undefined-property error in the console or browser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, react
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100