-
Notifications
You must be signed in to change notification settings - Fork 124
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]: npx @cloudflare/next-on-pages fails on windows #863
Comments
do you see this when just building the same app without next-on-pages? |
So definitely looking like a local setup issue. But I do not know what is missing locally. |
I got one step further but still failing. The original error is saying the directory doesn't exist. But because I'm in WSL the directory locations changes and has I get further but still run into an error. |
I was able to get this to run by fudging a few lines in index.js to play nicely with WSL. I'm sure there's a better way but this seems to work for now... Update Command to format cwd to WSL format (/mnt/ at start, flipping slashes and lowercasing drive letter, removing ':', replacing usage of {cwd} with {this.cwd} ) Add shell: true to options of vercel build child process spawn After making these tweaks (inside node_modules@cloudflare\next-on-pages\dist\index.js), run powershell/cmd prompt as Administrator and then the build should complete :) |
I'm getting this issue, too. I worked around it by running in WSL Ubuntu. It seems to be Windows specific. |
Making the changes suggested by @danbrownuk I was able to get the So at this time to do we not have out of the box support for Windows and Next.js development? I'm planning to build a full-stack Next.js app that uses multiple Bindings so that will likely be a better test of building and preview environments on Windows. |
Similarly, I'm having this problem |
same issue on WSL |
next-on-pages environment related information
PS C:\Users\tdesmond\Projects\cloudflare\temp\my-next-app> npx @cloudflare/next-on-pages --info
EXIT WHEN NOT EXPECTED
SHELLAC COMMAND FAILED!
Executing: npm --version in C:\Users\tdesmond\Projects\cloudflare\temp\my-next-app
STDOUT:
STDERR:
/bin/bash: line 1: cd: C:\Users\tdesmond\Projects\cloudflare\temp\my-next-app: No such file or directory
node:internal/process/promises:389
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".
at throwUnhandledRejectionsMode (node:internal/process/promises:389:7)
at processPromiseRejections (node:internal/process/promises:470:17)
at process.processTicksAndRejections (node:internal/process/task_queues:96:32) {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v20.16.0
Description
npx @cloudflare/next-on-pages
fails on my Windows machine. At this point it feels like something is configured wrong on my machine but I have not come across documentation pointing me to what I should set up.I have tried using the Windows Subsystem for Linux like the error for
npm run page:build
prompts me to do but there is no change in error when running in a Ubuntu terminal on Windows.Reproduction
I created a brand new Next.js application with
npm create cloudflare@latest my-next-app -- --framework=next
.I attempt to run
npm run pages:build
I get the following error.Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: