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

bug: Internal Server Error when running nextjs app locally on Windows #1280

Open
nickreynolds opened this issue Jan 5, 2025 · 6 comments · May be fixed by #1281
Open

bug: Internal Server Error when running nextjs app locally on Windows #1280

nickreynolds opened this issue Jan 5, 2025 · 6 comments · May be fixed by #1281

Comments

@nickreynolds
Copy link

Provide environment information

System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 35.56 GB / 63.91 GB
  Binaries:
    Node: 22.12.0 - C:\nvm4w\nodejs\node.EXE
    npm: 10.9.0 - C:\nvm4w\nodejs\npm.CMD
    pnpm: 9.15.2 - C:\nvm4w\nodejs\pnpm.CMD
    bun: 1.1.40 - ~\.bun\bin\bun.EXE

Describe the bug

From a fresh clone of this repo (on a windows machine), I ran pnpm i, set my DB URL, and then ran pnpm dev.

When I load localhost:3000 in the browser, I see "Internal Server Error" rendered, and the nextjs app logs look like this:

│>>> tRPC Request from rsc by undefined
│⨯ Internal error: TypeError: Cannot read properties of undefined (reading 'default')
at resolveClientReference (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:87:55)
│    at resolveModule (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:1667:35)       
│    at processFullRow (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:1740:25)      
│    at processBinaryChunk (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:1858:21)  
│    at progress (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js:1926:17)
│    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
│digest: "4207119005"
│[TypeError: Cannot read properties of undefined (reading 'default')]
│ ⨯ [TypeError: Cannot read properties of undefined (reading 'default')]
│ ⨯ [TypeError: Cannot read properties of null (reading 'default')]
│ GET / 500 in 1804ms

Doing the exact same thing on my Mac does not show an error and the page renders correctly.

Link to reproduction

fresh clone of this repo

To reproduce

From a fresh clone of this repo, I ran pnpm i, set my DB URL, ran pnpm db:push, and then ran pnpm dev.

This is on windows, using Powershell (in VS Code) with nvm-windows installed.

Additional information

This appears to be a windows-only issue, but not sure why other users on Windows haven't reported it. For me, the project is entirely unusable for development on Windows.

@nickreynolds
Copy link
Author

just to be sure, I uninstalled nvm-windows and manually installed nodejs@22, and the issue still persists

@nickreynolds
Copy link
Author

I believe this issue is just related to this:

vercel/next.js#53562

I "fixed" my issue by removing the lines export const runtime = "edge";

Still, I think a note/warning should be added to the README so that developers know there is currently an issue with edge+nextjs+turbopack and they should remove those lines if using Windows for development.

@noxify
Copy link
Contributor

noxify commented Jan 6, 2025

hey @nickreynolds ,

there is already a note in the readme :)

image

@nickreynolds
Copy link
Author

@noxify I guess my point is that the note should mention that Windows does not support the edge runtime with nextjs+turbo. The error message produced is not too helpful and it wasn't clear that disabling edge was what I needed to do to proceed.

@noxify
Copy link
Contributor

noxify commented Jan 6, 2025

Got it - maybe you could provide a PR with the changes to make it clear.

But I think it's a general problem, not only windows. ( please correct me if I'm wrong )

@nickreynolds
Copy link
Author

@noxify I'll try to make a PR updating the note when I think of the right wording ;)

I'm not aware of any other dev envs that don't support edge runtime with turbo. The issue I linked describes a Windows-only issue. I suppose there probably are others, but I would let future contributors point those out when issues are encountered.

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

Successfully merging a pull request may close this issue.

2 participants