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 not working with windows #23164

Closed
2 of 4 tasks
marcelloinfoweb opened this issue Sep 13, 2023 · 17 comments
Closed
2 of 4 tasks

Bun not working with windows #23164

marcelloinfoweb opened this issue Sep 13, 2023 · 17 comments

Comments

@marcelloinfoweb
Copy link

marcelloinfoweb commented Sep 13, 2023

Describe the feature

It is compatible with Bun?

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@warflash
Copy link
Member

Probably better suited for a discussion, but yes, nuxt is. -> https://bun.sh/guides/ecosystem/nuxt

@huang-julien
Copy link
Member

huang-julien commented Sep 13, 2023

Yes it is on the edge channel of nitro, you can set the resolution of nitropack to the edge channel to test it out
https://nuxt.com/docs/getting-started/deployment#presets
https://nitro.unjs.io/deploy/providers/bun

@huang-julien huang-julien closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2023
@marcelloinfoweb
Copy link
Author

But it doesn't work, it keeps crashing, whether in projects already under development or in a clean installation.

Gravando.2023-09-12.230753.mp4

@huang-julien huang-julien reopened this Sep 13, 2023
@pi0
Copy link
Member

pi0 commented Sep 13, 2023

@marcelloinfoweb Please provide a reproduction environment (your operating system, Bun version and Nuxt/Nuxi version you can get via nuxi info).

Bun works with Windows on MacOS and Linux but it seems you are on windows which is currently an experimental target for Bun according to their docs.

@pi0 pi0 changed the title Bun js Bun not working with windows Sep 13, 2023
@pi0 pi0 added the windows label Sep 13, 2023
@mario-neuhold
Copy link
Contributor

(possible solution at the end?)

naked install via bun x nuxi init nuxt-test already throws an error:

image

but it still gets installed and can be started via bun --bun run dev yet it hangs, same behaviour as in @marcelloinfoweb's video. seems like it is only loading the <head>:

image

network tab:
image

browser console output is empty.

nuxi info:

Working directory: /home/user/nuxt-test
Nuxt project info:

------------------------------
- Operating System: Linux
- Node Version:     v18.15.0
- Nuxt Version:     3.7.2
- CLI Version:      3.8.3
- Nitro Version:    2.6.3
- Package Manager:  [email protected]
- Builder:          -
- User Config:      devtools
- Runtime Modules:  -
- Build Modules:    -
------------------------------

windows info:

Edition	Windows 11 Pro
Version	22H2
Build	22621.2283

wsl info:

C:\Users\User>wsl -l -v
  NAME      STATE           VERSION
* Debian    Running         2

and after testing all this i just made a typo by typing bun dev... and it works :D seems like the "freeze" only happens with bun --bun run dev

@marcelloinfoweb
Copy link
Author

marcelloinfoweb commented Sep 13, 2023

Clean install as per Bun documentation

Working directory: /home/msc/projetos/my-nuxt-app 3:17:14 PM
Nuxt project info: 3:17:14 PM


  • Operating System: Linux (WSL 2)
  • Node Version: v18.17.1
  • Nuxt Version: 3.7.1
  • CLI Version: 3.7.3
  • Nitro Version: 2.6.3
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Edição Windows 11 Pro Insider Preview
Versão 22H2
Instalado em ‎09/‎09/‎2023
Compilação do SO 23541.1000
Experiência Windows Feature Experience Pack 1000.23541.1000.0

Powershell: wsl -l -v
NAME STATE VERSION

  • Ubuntu Running 2

@mario-neuhold
Copy link
Contributor

@marcelloinfoweb try bun dev instead of bun --bun run dev

@marcelloinfoweb
Copy link
Author

marcelloinfoweb commented Sep 13, 2023

@marcelloinfoweb try bun dev instead of bun --bun run dev

Yes, but following the documentation, without --bun, it runs with node, which makes no sense using bun, and it is better to use pnpm, do you agree?

https://bun.sh/guides/ecosystem/nuxt

The nuxt CLI uses Node.js by default; passing the --bun flag forces the dev server to use the Bun runtime instead.

@mario-neuhold
Copy link
Contributor

ah.. i didn't see that, thanks for the info! at least my hard work providing all those details isn't wasted then, hope it helps finding a solution.
i'm still blown away buy the fast package installation with bun.

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

Please consider that bun install (package manager) is not (yet) supported on windows. You might need to choose another package manager (like pnpm or npm) and leverage bun dev for runtime performances.

@marcelloinfoweb
Copy link
Author

Please consider that bun install (package manager) is not (yet) supported on windows. You might need to choose another package manager (like pnpm or npm) and leverage bun dev for runtime performances.

I understand, but I'm not running on Windows directly but on WSL (Ubuntu), which is a system that runs the native Linux kernel. It should work.

@mario-neuhold
Copy link
Contributor

yep, we are talking WSL (windws subsystem linux), not native windows build:
image

just for reference, there is a bun-ticket for this problem as well: oven-sh/bun#4743

i tried some other related stuff with bun: vue3/vite and nitro apps are all working on bun with WSL

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

Thanks for confirmation! Let's track it via upstream then (i have also subscribed for updates)

@angelhdzmultimedia
Copy link
Contributor

yep, we are talking WSL (windws subsystem linux), not native windows build: image

just for reference, there is a bun-ticket for this problem as well: oven-sh/bun#4743

i tried some other related stuff with bun: vue3/vite and nitro apps are all working on bun with WSL

I'm having the error: script "dev" exited with code 11 (SIGSEGV) in a Vite + Vue 3 project.
Apparently it's not only Nuxt. It's a problem with HMR in Vite.
I make some changes in a .vue file, and bam, program crashes with error.

@pi0
Copy link
Member

pi0 commented Oct 16, 2023

We would still be happy to track it if can find a workaround for Nuxt side. Only when an issue is closed, please consider making a fresh new issue mentioning exact nuxt and bun versions + platform (wsl, linux, macos, etc) and feel free to ping me to investigate 👍🏼

@angelhdzmultimedia
Copy link
Contributor

Apparently latest version of bun fixed issues with Vite and Rollup and now Nuxt works, can someone confirm? oven-sh/bun#4743 (comment)

@mario-neuhold
Copy link
Contributor

yeah i just comfirmed it over there too - works for me on win11 with wsl in a fresh nuxt3 and even with the tailwindcss nuxt module:

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:    -
------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants