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

bun --bun run dev fails with nuxt #4743

Closed
terion-name opened this issue Sep 9, 2023 · 83 comments · Fixed by #5360
Closed

bun --bun run dev fails with nuxt #4743

terion-name opened this issue Sep 9, 2023 · 83 comments · Fixed by #5360
Labels
bug Something isn't working needs investigate Needs to be investigated to find the root cause

Comments

@terion-name
Copy link

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

Darwin 22.4.0 arm64 arm

What steps can reproduce the bug?

install fresh nuxt with bun and try to run bun --bun run dev

What is the expected behavior?

It works

What do you see instead?

The app is not starting.

No errors in console, no network failures, app just hangs on request.

Build log also has nothng strange. ℹ Vite client warmed up in 6487ms, ✔ Nitro built in 1636 ms

But it just not working

Additional information

If I run bun run dev (without --bun) then everything works fine. But as of docs that means that in this case nuxt cli uses node. Which is not present for example in docker

@terion-name terion-name added the bug Something isn't working label Sep 9, 2023
@terion-name
Copy link
Author

With bun --bun run dev page load halts on this:
Снимок экрана 2023-09-10 в 01 56 14

Without --bun app loads normally:
Снимок экрана 2023-09-10 в 01 57 46
etc

@angelhdzmultimedia
Copy link

angelhdzmultimedia commented Sep 10, 2023

Same here man. I was excited to try it but it hangs. Sometimes I get the nuxt logo loading screen and stuck. Other times the browser window stays empty.
Using bun x1. Latest nuxt (which was announced compatibility with bun x1). All deps updated. Latest VSCode. Reloaded workspace.
Closed all open tabs and retried to rule out websocket issues.

I hope this gets solved. In the meantime I will keep playing with vanilla bun. Cheers!

Edit: I'm on Windows 11 Home using Ubuntu (WSL) .

@texastoland
Copy link

Dup #3771?

@orenmizr
Copy link

hmm, does nuxt work with bun 1.0 ? is it stable ? any gotchas ? should one make the switch ?

@Giton22
Copy link

Giton22 commented Sep 11, 2023

Just run it without --bun as per Nuxt docs. I guess Bun's one are outdated.

This runs with Node runtime not with Bun so makes no sense.

@octet-stream
Copy link

I also have issues running a fresh Nuxt project. But for me it just gets stuck loading a welcome page (Chrome shows spinner and the page never loads). I did what this guide says: https://bun.sh/guides/ecosystem/nuxt

@angelhdzmultimedia
Copy link

angelhdzmultimedia commented Sep 11, 2023

Update

In my case, I managed to get it working on replit. There's a template with bun x1, and I did the same steps to create a nuxt project, install deps and run the dev server, and it worked (the only issue is that the <NuxtWelcome/> component was missing the CSS styles...)

The difference is, in my computer I'm on Windows 11 with Ubuntu WSL terminal, and on replit it's pure Linux terminal.

I'm also following this guide: https://bun.sh/guides/ecosystem/nuxt

This is what my browser window looks like after running bun --bun run dev:
image

And my WSL terminal and editor (VSCode):
image

@jackheuberger
Copy link

Experiencing the same issues on my WSL instance. Following instructions to run with bun on the site here resulted in an error saying ERROR Cannot start nuxt: {}. Following the guide to create a new project, I get the same as described above (blank chrome screen)

@Giton22
Copy link

Giton22 commented Sep 12, 2023

Experiencing the same issues on my WSL instance. Following instructions to run with bun on the site here resulted in an error saying ERROR Cannot start nuxt: {}. Following the guide to create a new project, I get the same as described above (blank chrome screen)

I didn't even get any Error message that's why it's so hard to find out what's wrong with it. I was expecting the latest Nuxt to be compatible via Wsl but that's not the case. I hope we get some response about this issue.

@Ralph-Imholz
Copy link

Same here on WSL Ubuntu. Runs fine on Node in Windows.

@Antonio-Bennett
Copy link

I'm using sveltekit but vite dev does not work for me as well on WSL. Windows 11

@marcelloinfoweb
Copy link

v1.0.1 fixed this for me.

Continuous with error.

Nuxt 3.7.2 (Vite 4.4.9)
Bun 1.0.1
WSL 2 Ubuntu 22.04

Gravando.2023-09-12.225019.mp4

@angelhdzmultimedia
Copy link

angelhdzmultimedia commented Sep 13, 2023

Bun upgraded to 1.0.1, Windows 11 Ubuntu WSL...

image

@marcelloinfoweb
Copy link

Bun upgraded to 1.0.1...

image

WSL?

@angelhdzmultimedia
Copy link

Bun upgraded to 1.0.1...
image

WSL?

Yes but it got stuck there.

@angelhdzmultimedia
Copy link

Wut!? New error...
image

@marcelloinfoweb
Copy link

Clean install, as per Bun documentation.

Gravando.2023-09-12.230753.mp4

@marcelloinfoweb
Copy link

Wut!? New error... image

It happened to me too

@Object905
Copy link

I've tried to get nuxi build --bun working on fairly big project, but mostly got SIGSEGV.
In some configurations got css import errors, probably due to unplugin-element-plus. Got similar errors when using yarn instead of npm previously.
Also noticed that error changed when tried different combinations of bun install/npm install and npm run build/bun run build.

@pi0
Copy link

pi0 commented Sep 14, 2023

We are streaming a few patches to the nuxi to address some relevant issues and i am constantly checking with a WSL2 env. Would be nice if you can try with bun --bun x nuxi-edge@latest dev and share the results.

@nathanchase
Copy link

We are streaming a few patches to the nuxi to address some relevant issues and i am constantly checking with a WSL2 env. Would be nice if you can try with bun --bun x nuxi-edge@latest dev and share the results.

❯ bun --bun x nuxi-edge@latest dev
[0.03ms] ".env"
Nuxt 3.7.3 with Nitro 2.6.3                                                                                 

 ERROR  Cannot access uninitialized variable.                                                               

  at <anonymous> (:165:22)
  at evalModule (node_modules/jiti/dist/jiti.js:0:0)
  at jiti (node_modules/jiti/dist/jiti.js:0:0)
  at <anonymous> (node_modules/c12/dist/index.mjs:281:27)
  at resolveConfig (node_modules/c12/dist/index.mjs:234:23)
  at <anonymous> (node_modules/c12/dist/index.mjs:116:6)
  at processTicksAndRejections (:1:1302)

 ERROR  Cannot access uninitialized variable.                                                               

error: "nuxi" exited with code 1 (SIGHUP)

@marcelloinfoweb
Copy link

Estamos transmitindo alguns patches para o nuxi para resolver alguns problemas relevantes e estou constantemente verificando com um WSL2 env. Seria bom se você pode tentar com bun --bun x nuxi-edge@latest dev and share the results.

For me it doesn't load anything, blank screen and the favicon running

@Jarred-Sumner
Copy link
Collaborator

#5360 does not fix it. In the hacker news demo app, it loads the page once and then fails to load subsequently.

@Colonel-Sandvich
Copy link

I'm having exactly the same issue but I'm on Linux (Fedora 38) and not WSL like everyone else in this thread.
Am I encountering the same bug or a different one that needs a different issue?

@ktiedt
Copy link

ktiedt commented Sep 16, 2023

v1.0.1 fixed this for me.

1.0.2 is broke for me on Mac, latest OS updates, latest bun, fresh project following the guide from Bun's example pages.

@Ralph-Imholz
Copy link

Apparently v1.0.13 solved it... can someone confirm? I've been doing many Hot Reloads and the error is gone.

(Windows Ubuntu WSL, nuxt 3.9.0, bun 1.0.13)

#7205

Yup no issues here today after upgrading to 1.0.13.

@jovobe
Copy link

jovobe commented Nov 20, 2023

Thank you for your continuous work on this! 1.0.13 fixed it for macOS as well 🎉

bunx nuxi info output:

- Operating System: Darwin
- Node Version:     v21.2.0
- Nuxt Version:     3.8.1
- CLI Version:      3.9.1
- Nitro Version:    2.7.2
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools, modules
- Runtime Modules:  @nuxtjs/[email protected]
- Build Modules:    -

I'm on macOS 14.1.1 (23B81).

@scottix
Copy link

scottix commented Nov 22, 2023

Still getting error on WSL Ubuntu 22.04

It worked initially but then got into Tailwindcss and stopped working

bunx nuxi info

Nuxt project info:                                                                                                                                                                         1:57:17 PM

------------------------------
- Operating System: Linux
- Node Version:     v20.8.0
- Nuxt Version:     3.8.2
- CLI Version:      3.10.0
- Nitro Version:    2.8.0
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools
- Runtime Modules:  -
- Build Modules:    -
------------------------------

bun dev

bun dev
$ nuxt dev
Nuxt 3.8.2 with Nitro 2.8.0                                                                                                                                                                1:59:56 PM
                                                                                                                                                                                           1:59:56 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

  ➜ DevTools: press Shift + Alt + D in the browser (v1.0.3)                                                                                                                                1:59:57 PM

ℹ Vite server warmed up in 1326ms                                                                                                                                                         1:59:59 PM
error: script "dev" exited with code 11 (SIGSEGV)

package.json

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@nuxt/devtools": "latest",
    "autoprefixer": "^10.4.16",
    "nuxt": "^3.8.2",
    "postcss": "^8.4.31",
    "tailwindcss": "^3.3.5",
    "vue": "^3.3.8",
    "vue-router": "^4.2.5"
  }
}

@mario-neuhold
Copy link

Still getting error on WSL Ubuntu 22.04

It worked initially but then got into Tailwindcss and stopped working

@scottix have you tried the nuxt tailwind module? @nuxtjs/tailwindcss (installed via devtools! ♥) works for me in a naked nuxt3 install:

bunx nuxi info
Working directory: /home/user/wsl-dev/nuxt3                                                                 8:58:57 AM
Nuxt project info:                                                                                          8:58:57 AM

------------------------------
- Operating System: Linux
- Node Version:     v18.17.1
- Nuxt Version:     3.8.2
- CLI Version:      3.10.0
- Nitro Version:    2.8.0
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools, modules
- Runtime Modules:  @nuxtjs/[email protected], @pinia/[email protected]
- Build Modules:    -
------------------------------

@scottix
Copy link

scottix commented Nov 24, 2023

Still getting error on WSL Ubuntu 22.04
It worked initially but then got into Tailwindcss and stopped working

@scottix have you tried the nuxt tailwind module? @nuxtjs/tailwindcss (installed via devtools! ♥) works for me in a naked nuxt3 install:

bunx nuxi info
Working directory: /home/user/wsl-dev/nuxt3                                                                 8:58:57 AM
Nuxt project info:                                                                                          8:58:57 AM

------------------------------
- Operating System: Linux
- Node Version:     v18.17.1
- Nuxt Version:     3.8.2
- CLI Version:      3.10.0
- Nitro Version:    2.8.0
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools, modules
- Runtime Modules:  @nuxtjs/[email protected], @pinia/[email protected]
- Build Modules:    -
------------------------------

Yes this method is working.

@mihailtd
Copy link

I still have this issue with v 1.0.14, but only when using the Docker container:

FROM oven/bun:1.0.14-alpine

WORKDIR /app

COPY ./package.json ./package.json
COPY ./bun.lockb ./bun.lockb
COPY ./@app/client ./@app/client

RUN bun install

EXPOSE 3000

WORKDIR /app/@app/client

CMD ["bun", "run", "dev" "--host"]

I get one of the following errors:

fatal error: all goroutines are asleep - deadlock!
error: script "dev" exited with code 9 (SIGKILL)

or

error: script "dev" exited with code 11 (SIGSEGV)

@renepardon
Copy link

I can confirm that with FROM oven/bun:1.0.15 as base there is still the same error when building a NuxtJS v3 application with Docker:

160.4 ℹ Building client...
160.4 ℹ vite v4.5.1 building for production...
160.4 ℹ transforming...
163.8 error: script "build" exited with code 11 (SIGSEGV)
------
Dockerfile:27
--------------------
  25 |     ENV NODE_ENV=production
  26 |     RUN bun test
  27 | >>> RUN bun run build
  28 |     
  29 |     # copy production dependencies and source code into final image
--------------------
ERROR: failed to solve: process "/bin/sh -c bun run build" did not complete successfully: exit code: 1

What I tried so far on MacOS 13.6 (22G120):

  • I upgraded to latest Docker Desktop version 4.26.0 (130397) - before I had 4.25.2 (129061)
  • Changed Memory limit in Docker Desktop settings to 10GB (before I had 6GB and also received some memory related issues)
  • tried building explicitly without Cache.

My Dockerfile:

FROM oven/bun:1.0.15 as base
WORKDIR /usr/src/app

FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile

RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .

ENV NODE_ENV=production
RUN bun test
RUN bun run build

FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/index.ts .
COPY --from=prerelease /usr/src/app/package.json .

USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "index.ts" ]

@angelhdzmultimedia
Copy link

angelhdzmultimedia commented Dec 10, 2023

💔😢Sadly getting the error again. Started the dev server of the project I've been trying bun with,
app was mounted, then I added a useHead call on the script setup of the app component, and crashed with error:
image

(Windows 11, WSL Ubuntu)

@renepardon
Copy link

Today it was working the whole day and I guess the problem was mounting node_modules into the docker container for easier development. Excluding node_modules within docker-compose made it work. But even with the newly released 1.0.16 I have this problem again now:

bunx --bun nuxi info:

------------------------------
- Operating System: Darwin
- Node Version:     v20.8.0
- Nuxt Version:     3.8.2
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools, modules, googleFonts, css
- Runtime Modules:  @pinia/[email protected], @nuxtjs/[email protected], [email protected], [email protected], @pinia-plugin-persistedstate/[email protected], [email protected]
- Build Modules:    -
------------------------------

Running locally works on Mac OS.

What I figured out is that the error started when I tried adding @nuxt/image. But even after removing it (because with ipx, the images are just not found) I keep receiving:

ERROR Cannot start nuxt: ResolveMessage {}

and

error: script "dev" exited with code 11 (SIGSEGV)

I deleted node_modules and re-created my docker container (because inside the container I have an isolated node_modules directory). But nothing works anymore.

@okumaru
Copy link

okumaru commented Jan 2, 2024

in my own case,

$ nuxt dev
[6:25:47 PM] Nuxt 3.9.0 with Nitro 2.8.1
[6:25:48 PM] 
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

[6:25:56 PM] ℹ Vite client warmed up in 2530ms
[6:25:59 PM] ℹ Vite server warmed up in 3738ms
[nitro 6:26:03 PM] ✔ Nitro built in 5592 ms
[6:28:37 PM] ℹ nuxt.config.ts updated. Restarting nuxt...
[6:28:39 PM]   ➜ DevTools: press Shift + Alt + D in the browser (v1.0.6)

error: script "dev" was terminated by signal SIGSEGV (Address boundary error)
Segmentation fault (core dumped)

with Pop!_OS 22.04 LTS bunx --bun nuxi info result,

------------------------------
- Operating System: Linux
- Node Version:     v20.8.0
- Nuxt Version:     3.9.0
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools
- Runtime Modules:  -
- Build Modules:    -
------------------------------

To solve the problem temporary, I did disable devtool in nuxt.config.ts

export default defineNuxtConfig({
  devtools: { enabled: false },
})

Result from my device is like this

$ nuxt dev
[8:48:26 PM] Nuxt 
[8:48:27 PM] 
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

[8:48:36 PM] ℹ Vite client warmed up in 3173ms
[8:48:38 PM] ℹ Vite server warmed up in 3681ms
[nitro 8:48:40 PM] ✔ Nitro built in 3787 ms

and sometime I need to run command bun pm cache rm,
to make sure cache is empty

@angelhdzmultimedia
Copy link

in my own case,

$ nuxt dev
[6:25:47 PM] Nuxt 3.9.0 with Nitro 2.8.1
[6:25:48 PM] 
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

[6:25:56 PM] ℹ Vite client warmed up in 2530ms
[6:25:59 PM] ℹ Vite server warmed up in 3738ms
[nitro 6:26:03 PM] ✔ Nitro built in 5592 ms
[6:28:37 PM] ℹ nuxt.config.ts updated. Restarting nuxt...
[6:28:39 PM]   ➜ DevTools: press Shift + Alt + D in the browser (v1.0.6)

error: script "dev" was terminated by signal SIGSEGV (Address boundary error)
Segmentation fault (core dumped)

with Pop!_OS 22.04 LTS bunx --bun nuxi info result,

------------------------------
- Operating System: Linux
- Node Version:     v20.8.0
- Nuxt Version:     3.9.0
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools
- Runtime Modules:  -
- Build Modules:    -
------------------------------

To solve the problem temporary, I did disable devtool in nuxt.config.ts

export default defineNuxtConfig({
  devtools: { enabled: false },
})

Result from my device is like this

$ nuxt dev
[8:48:26 PM] Nuxt 
[8:48:27 PM] 
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

[8:48:36 PM] ℹ Vite client warmed up in 3173ms
[8:48:38 PM] ℹ Vite server warmed up in 3681ms
[nitro 8:48:40 PM] ✔ Nitro built in 3787 ms

and sometime I need to run command bun pm cache rm, to make sure cache is empty

Environment

  • Windows 11 (WSL Ubuntu)

Description

In my case, I disabled devtools, ran bun upgrade and bunx nuxi@latest upgrade -f and when I change anything in a .vue file, I get:

ℹ hmr update /test.vue (x5)                                                                                                   12:34:45 PM
error: script "dev" was terminated by signal SIGSEGV (Address boundary error)                                                  12:34:45 PM
Segmentation fault

Screen Capture

chrome_udQrnFl8jl.mp4

(apologies for the unusual light mode, I'm experimenting 👀)

Final Words

I'm still thinking the issue is related to HMR...

@shtse8
Copy link

shtse8 commented Mar 6, 2024

Today it was working the whole day and I guess the problem was mounting node_modules into the docker container for easier development. Excluding node_modules within docker-compose made it work. But even with the newly released 1.0.16 I have this problem again now:

bunx --bun nuxi info:

------------------------------
- Operating System: Darwin
- Node Version:     v20.8.0
- Nuxt Version:     3.8.2
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools, modules, googleFonts, css
- Runtime Modules:  @pinia/[email protected], @nuxtjs/[email protected], [email protected], [email protected], @pinia-plugin-persistedstate/[email protected], [email protected]
- Build Modules:    -
------------------------------

Running locally works on Mac OS.

What I figured out is that the error started when I tried adding @nuxt/image. But even after removing it (because with ipx, the images are just not found) I keep receiving:

ERROR Cannot start nuxt: ResolveMessage {}

and

error: script "dev" exited with code 11 (SIGSEGV)

I deleted node_modules and re-created my docker container (because inside the container I have an isolated node_modules directory). But nothing works anymore.

I have the issue and message when I run bun --bun run dev or bun run dev without installing node. Everything works fine using node.

@angelhdzmultimedia
Copy link

😭 bun is sooo fast but can't use it with Nuxt!!!

Created a new Nuxt project, bunx --bun nuxi upgrade -f, bun --bun run dev, changed some code in the ~/app.vue, error!

image

@ktiedt
Copy link

ktiedt commented Mar 24, 2024 via email

@angelhdzmultimedia
Copy link

angelhdzmultimedia commented Mar 24, 2024

Seems to be working well for us with nuxt these days.

-Karl Tiedt
On Sun, Mar 24, 2024 at 12:58 AngelHdz Multimedia @.> wrote: 😭 bun is sooo fast but can't use it with Nuxt!!! Created a new Nuxt project, bunx --bun nuxi upgrade -f, bun --bun run dev, changed some code in the ~/app.vue, error! image.png (view on web) https:/oven-sh/bun/assets/10191085/ba5c3789-5cc3-49f1-b319-f8f3392f8fbb — Reply to this email directly, view it on GitHub <#4743 (comment)>, or unsubscribe https:/notifications/unsubscribe-auth/AAAXXWQ3VNWOUZK3ZQI4IQLYZ4H35AVCNFSM6AAAAAA4RXIRBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWHA4DMOBUG4 . You are receiving this because you commented.Message ID: @.>

bun run dev or bun --bun run dev or both?

I just noticed that when I removed the --bun flag, the error seems to have gone... 🤔
I've been changing the code, installing deps, restarting the server, adding assets with Nuxtr, and it's working...

@ktiedt
Copy link

ktiedt commented Mar 24, 2024 via email

@wJoenn
Copy link

wJoenn commented Mar 24, 2024

@ktiedt the problem never was with bun run dev
This commands simply launch the node process like any other package manager would (pnpm run dev, npm run dev etc)
The issue is running Nuxt with Bun as the runtime, that what the --bun flag does, it tells bun to run on with bun as the runtime instead of node

@angelhdzmultimedia
Copy link

@ktiedt the problem never was with bun run dev This commands simply launch the node process like any other package manager would (pnpm run dev, npm run dev etc) The issue is running Nuxt with Bun as the runtime, that what the --bun flag does, it tells bun to run on with bun as the runtime instead of node

So, I should assume that I got it working without the --bun flag, because I installed Node in WSL (Ubuntu), so it's running as Node and not as Bun? 😭🤯

@ktiedt
Copy link

ktiedt commented Mar 24, 2024 via email

@4F2E4A2E
Copy link

4F2E4A2E commented Mar 29, 2024

+1 using docker image oven/bun:1.0.35-slim

$ bun --bun x nuxi-edge@latest build 
Nuxt 3.11.1 with Nitro 2.9.5
[nuxt:tailwindcss] ℹ Using default Tailwind CSS file
ℹ Building client...
ℹ vite v5.2.7 building for production...
ℹ transforming...
Segmentation fault
$ bunx --bun nuxi info
Working directory: /app
Nuxt project info: 

------------------------------
- Operating System: Linux
- Node Version:     v21.6.0
- Nuxt Version:     3.11.1
- CLI Version:      3.11.1
- Nitro Version:    2.9.5
- Package Manager:  [email protected]
- Builder:          -
- User Config:      ssr, srcDir, modules, css, build, runtimeConfig, colorMode, devtools, typescript
- Runtime Modules:  @nuxt/[email protected]
- Build Modules:    -
------------------------------
$ bun run build # nuxt build
Nuxt 3.11.1 with Nitro 2.9.5
[nuxt:tailwindcss] ℹ Using default Tailwind CSS file
ℹ Building client...
ℹ vite v5.2.7 building for production...
ℹ transforming...
error: script "build" was terminated by signal SIGSEGV (Address boundary error)
Segmentation fault

@angelhdzmultimedia
Copy link

Update

I just tried Bun Windows. Awesome work to the team.

But Nuxt still not working.
When I run bunx nuxi init it creates the Nuxt project, but uses Node to install deps, because it's very slow compared to when I used Bun on WSL. So I then deleted the project, and started with bunx --bun nuxi init, then I get the prompt to select the package manager, but I can't use any keyboard key to select!!!

So I'm back at point zero... 😭

@mxrch
Copy link

mxrch commented Apr 12, 2024

I confirm we still can't use Tailwind with Bun 1.1.3 on Windows.. :(
Got this error :

Internal server error: [postcss] Cannot access uninitialized variable.

@Jarred-Sumner
Copy link
Collaborator

I think this was fixed in #11635 and #11494. Running bun --bun run dev on a Nuxt example app and sending 10,000 requests works. Running bun --bun run build in hyperfine also works (which runs it many times over).

If you're still running into this issue in Bun v1.1.13 or later, please let us know and I'll re-open the issue.

@mxrch unfortunately that issue is unrelated, but it should at least have a better error message in the next release as we have added the variable name to ReferenceError (oven-sh/WebKit#56). There's also a chance that one is fixed in the next release if postcss does something like const Infinity = 1 / 0 (#11585). If you're still running into that, please open a new issue and we will fix it.

@ghyath5
Copy link

ghyath5 commented Jun 9, 2024

bun --bun run dev is working well

Running it in production
bun --bun run build and starting the server
bun --bun .output/server/index.mjs
this creates many errors on the first hit first request as missing packages like (jsoe) package
I don't have such a package name in my libs and even if we try to install it manually the error persists

@u007
Copy link

u007 commented Jun 9, 2024

this sounds like a nuxt issue, you might want to fall back to pnpm build and pnpm preview to test it
you might get the same error

@ghyath5
Copy link

ghyath5 commented Jun 10, 2024

Actually building and running it using nodejs is working

this error only appears with bun and I think this because of @authjs/core library

bun i && bun --bun run build && bun --bun .output/server/index.mjs

Listening on http://[::]:3000
[nuxt] [request error] [unhandled] [500] Cannot find package "jose" from .output/server/chunks/routes/api/auth/_..._.mjs"
  at new H3Error (./.output/server/chunks/runtime.mjs:1922:4)  
  at createError$1 (./.output/server/chunks/runtime.mjs:1955:26)  
  at <anonymous> (./.output/server/chunks/runtime.mjs:3420:25)  
  at processTicksAndRejections (:12:39)
  
export default defineNuxtConfig({
build: {
  transpile: ["@auth/core", "@panva/hkdf"],
},
authJs: {
  // authenticatedRedirectTo: "/projects",
  // guestRedirectTo: "/",
  baseUrl: process.env.AUTH_ORIGIN,
},
alias: {
  cookie: "cookie",
},...

@palermo-git
Copy link

FYI anyone else finding this closed issue still an issue as of July 2024 make sure you also have node installed. I had error on fresh ubuntu 24.04 with only bun - node was not installed. Once I added node (via nvvm) everything worked well.

I was mistaken and thought bun was independent from node.

@dalisys
Copy link

dalisys commented Jul 31, 2024

@Jarred-Sumner I am still facing the same error with Bun 1.1.21.

Just after I added Supabase 1.3.5 with
npx nuxi@latest module add supabase

bun --bun run dev doesn't work anymore
image

pnpm run dev or bun run dev works fine

nuxt version 3.12.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigate Needs to be investigated to find the root cause
Projects
None yet
Development

Successfully merging a pull request may close this issue.