Open jfelsinger opened 1 year ago
I confirm the issue, below my package.json :
{
"name": "nuxt-app",
"private": true,
"scripts": {
"nuxt:build": "nuxt build",
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"knex:migrate:latest": "knex migrate:latest",
"knex:seed:up": "knex seed:run"
},
"devDependencies": {
"@nuxt/image": "^1.1.0",
"nuxt": "^3.9.0",
"vue": "^3.4.3",
"vue-router": "^4.2.5"
},
"dependencies": {
"@nuxt/content": "^2.10.0",
"@nuxtjs/i18n": "next",
"@nuxtjs/tailwindcss": "^6.10.3",
"@vueuse/nuxt": "^10.7.1",
"knex": "^3.1.0",
"pg": "^8.11.3"
}
}
Same issue with the latest bun 1.0.23
same
@jfelsinger try setting the runtime preset to bun
in the nitro config. see https://nitro.unjs.io/deploy/runtimes/bun
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ["@nuxt/image"],
+ nitro: {
+ preset: 'bun',
+ }
})
What version of Bun is running?
1.0.11+f7f6233ea
What platform is your computer?
Linux 5.10.16.3-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
https://github.com/jfelsinger/nuxt-image-bun-reproduction
Steps to reproduce manually:
bunx nuxi@latest init <project-name>
bun i
bunx nuxi@latest module add image
bunx nuxi@latest build
orbun run build
bun .output/server/index.mjs
Step 5, actually running the deployment package is where the failure happens. Instead of the server starting-up, like occurs when running with
node .output/server/index.mjs
instead there is a failure with:What is the expected behavior?
That the the server starts when running
bun .output/server/index.mjs
to start the build package.What do you see instead?
Additional information
This issue I have reproduced in Docker, on a containerized linux environment (gitpod), and locally in WSL. The linked repo has everything setup to reproduce, and a dockerfile that can also reproduce the issue after the
.output
bundle is initially built.Then:
bun run docker
orbun .output/server/index.mjs
Running with
node .output/server/index.mjs
produces no such error, so perhaps it is an issue with bun's package resolution?https://github.com/nuxt/content/issues/2437