-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deno compile crash when try chdir #26175
Comments
@jlucaso1 I tried reproducing the issue using the same code you attached, but I added a log to see the output. As you can see in the attached pictures, it runs without any problem on my side. PS: I'm using Windows |
@MohammadSu1 i tested early in linux. Curious that works fine in windows 🤔 . Can you try in wsl? |
This happens because This seems to work: $ deno compile main.js
$ mkdir /tmp/deno-compile-chdir-deno-compile/chdir-deno-compile # replace with tmp dir for your executable
$ ./chdir-deno-compile |
I'm trying to poc using deno to create a standalone next.js executable with deno compile and I'm getting the same issue: I'm for now just using the latest next.js scaffold and set the output to "standalone". Then after renaming the server.js to server.cjs I run:
when running I get:
|
The next standalone init script looks like so: const path = require('path')
const dir = path.join(__dirname)
process.env.NODE_ENV = 'production'
process.chdir(__dirname)
const currentPort = parseInt(process.env.PORT, 10) || 3000
const hostname = process.env.HOSTNAME || '0.0.0.0'
…… So its failing on the
I don't understand the above entirely, but it seems that the next bootstrapping really works on a file system level, depending on the fact that the files are organized under a ".next" folder just beside the main entrypoint. So I'm wondering how just creating a missing temp folder would work? And how |
Oh, some progress. The way next does is a great fit for the include-flag of course. Some progress:
so now it starts but fails on creating some prerender cache folder under the temp directory… |
And also
Sorry if I have derailed this issue to be specifically about running next.js under deno since that's not the title… |
@hedefalk Have you been able to compile a Next.js server in standalone mode in the end? |
no, not into something working. |
Version: Deno 2.0.0
I've tried to compile a nextjs standalone compiled project and got this error when try to execute the compiled denojs version of this project:
Minimal repro:
deno compile -A main.js
./main
The text was updated successfully, but these errors were encountered: