Closed KirillTregubov closed 1 year ago
For me, I'm create vite it's okay, follow this guide https://bun.sh/guides/ecosystem/vite
For me, I'm create vite it's okay
Just tested, can confirm it works on my Mac as well. Doesn't work in WSL though.
Figured out the same issue here, tested with WSL and Kali
bun v1.0
Same issue in Bun 1.0 and Windows 11 and WSL (Ubuntu 22.04)
Same issue using bunx create-next-app
it freezes on the second question.
Windows 11 (WSL, Ubuntu)
can confirm on debian 12 and ubuntu 22 locally or remotely via ssh
Confirmed as well with Win10, WSL2, Ubuntu v22.
Having this issue across two PC's. Tried reformatting my laptop and reinstalling only WSL + Ubuntu to ensure there was no issues with it reaching to node
.
Oddly enough, bunx create-svelte test-app
will work, but bunx create-svelte
followed by entering the app name does not. bun create svelte
also hangs.
Though, on my work PC, bunx create-svelte test-app
will allow me to initialize the new app, but bun --bun run dev
and bun dev
both result in a very similar hang after echoing vite dev
.
Other frameworks like bunx create-next-app
and bunx create-astro
hang as well, irrelevant of whether the project name is supplied as an arg.
EDIT: Just installed Arch WSL
to ensure it wasn't the distro and am having the same problems.
Got the same issue here, I tried to create my nextjs app using this command bunx create-next-app
and it freezes on the second option too.
But funny thing is, it works fine when I created svelkit project using bunx command.
maybe related to prompts package? I do like this on my WSL
clone the prompts package and go to the directory
do:
bun example.js (hang on second question) node example.js (success and smooth)
maybe related to prompts package? I do like this on my WSL
clone the prompts package and go to the directory
do:
bun example.js (hang on second question) node example.js (success and smooth)
I have tried it, and it happened the same thing.
Got an idea from @sonyarianto , try to create you nextjs app by using this command (non-interactively) bunx create-next-app <your-project-name> --ts --tailwind --eslint --app --src-dir --use-bun --import-alias "@/*"
for more details, you can find it here https://nextjs.org/docs/pages/api-reference/create-next-app#non-interactive
it fixed my problem.
@ericklarsen glad you can solved it, non-interactive to the rescue jaiwakwkakawk
@ericklarsen glad you can solved it, non-interactive to the rescue jaiwakwkakawk
Well, what about other frameworks like Vite for example?
@devfakhzan maybe you can try using non-interactive option during create Vite https://github.com/vitejs/vite/tree/main/packages/create-vite
Able to reproduce on Ubuntu 22.04.3, amd64.
Same issue. Terminal freezes when bun create remix
System: Windows 11
Running using WSL Remotely in VS Code
Same issue.
Command: bunx create-next-app
in terminal
System: Windows 10 WSL Ubuntu 22
just have to manually write all the arguments for creating apps :O
Same problem is also encountered when doing bunx prisma init
same problem
bun x create-next-app
on wsl
*non-interactive version works fine
I have the same issue with bunx create-next-app
. Freezes on second question.
It turns out that this issue arises when node is not installed.
You can verify this by trying it again when node is installed vs not installed. (I'm using nvm)
I'm using WSL Ubuntu 22.04.2 LTS
Apparently, other tools are broken as well when only bun is installed and not node. e.g. bun x vercel build
Same issue Win11 - WSL2/Ubuntu 22.04 - Node 18.16.3
bunx create-next-app@latest buntest ✔ Would you like to use TypeScript? … No / Yes ? Would you like to use ESLint? › No / Yes
bunx create-next-app@latest buntest --ts --eslint --tailwind
✔ Would you like to use src/
directory? … No / Yes
? Would you like to use App Router? (recommended) › No / Yes
using strictly CLI s a workaround bunx create-next-app@latest buntest --ts --tailwind --eslint --app --src-dir --use-bun --import-alias a
sudo apt-get install nodejs also fixes it
use this command
bun x create-next-app
its working for me
Finally managed to run "bun create vite" command on my WSL 2. Some hints:
Make sure you have installed the latest versions of the following:
I think Vite template still uses some of the Node modules so this is the only way. I'm not an expert, so be kind with your messenger, okay?
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
Windows version: KB5029263
What steps can reproduce the bug?
- Run
bunx create-next-app
- Skip naming project (press enter)
- Try to choose TypeScript (press enter)
OR
- Run
bun create vite
- Skip naming project (press enter)
- Try to select Vanilla (press enter)
What is the expected behavior?
(tested with npx/npm, assume bun output is the same)
bunx create-next-app √ What is your project named? … my-app √ Would you like to use TypeScript? ... No / Yes ? Would you like to use ESLint? » No / Yes
OR
bun create vite √ Project name: ... vite-project √ Select a framework: » Vanilla ? Select a variant: » - Use arrow-keys. Return to submit. > TypeScript JavaScript
What do you see instead?
bunx create-next-app ✔ What is your project named? … my-app ? Would you like to use TypeScript? › No / Yes
OR
bun create vite ✔ Project name: … vite-project ? Select a framework: › - Use arrow-keys. Return to submit. ❯ Vanilla Vue React Preact Lit Svelte Solid Qwik Others
Additional information
It seems like interactive CLI prompts make my WSL terminal unresponsive when running scripts using
bunx
orbun create
as opposed to their npx/npm counterparts. The unresponsiveness can be characterized as inability to use input keys (arrows, enter) or exit keys (Ctrl+C). Most notably text prompts work perfectly fine (the first inputs in these scripts).This seems to be specific to WSL, but I did not test on Linux (tested working on Mac). #4646 seems to have the same issue.
Having the same issue Ubuntu 22.04 freshly installed using Microsoft's WSL installation guide Freezes when selecting a variant
The same thing. not working on wsl. (debian) I got up in this section only because the runtime's behavior was hung.
: bun create vite
✔ Project name: … vite-project
? Select a framework: › - Use arrow-keys. Return to submit.
❯ Vanilla
Vue
React
Preact
Lit
Svelte
Solid
Qwik
Others
Confirmed on win10 wsl ubuntu
~/next-js$ bun Bun: a fast JavaScript runtime, package manager, bundler and test runner. (1.0.1)
run ./my-script.ts Run JavaScript with Bun, a package.json script, or a bin test Run unit tests with Bun x next Install and execute a package bin (bunx) repl Start a REPL session with Bun
init Start an empty Bun project from a blank template create next-app Create a new project from a template (bun c)
install Install dependencies for a package.json (bun i) add hono Add a dependency to package.json (bun a) remove moment Remove a dependency from package.json (bun rm) update react Update outdated dependencies & save to package.json link Link an npm package globally unlink Globally unlink an npm package pm More commands for managing packages
build ./a.ts ./b.jsx Bundle TypeScript & JavaScript into a single file
upgrade Get the latest version of Bun bun --help Show all supported flags and commands
Learn more about Bun: https://bun.sh/docs Join our Discord community: https://bun.sh/discord
~/next-js$ bun create next-app /mnt/c/Users/femin/AppData/Roaming/npm/node_modules/node/bin/node: 1: This: not found error: "create-next-app" exited with code 127
AppData/Roaming/npm/node_modules/node/bin/node: 1: This: not found error: "create-next-app" exited with code 127
I get a direct error
Windows 10 - wsl
For Vitejs, using scafolding works correct on Ubuntu server 22.04 on VM
https://vitejs.dev/guide/#scaffolding-your-first-vite-project
For Vitejs, using scafolding works correct on Ubuntu server 22.04 on VM
https://vitejs.dev/guide/#scaffolding-your-first-vite-project
Yea, this one works but, by using pnpm it doesn't work.
I fixed this by installing Node inside the WSL environment. Don't ask me how this is related to Bun, but it worked!
Woks here, unsing win 11 LTS, with WSL2 Ubuntu 22.04.3 LTS, using NVM to install latest node(v20.6.1), bun 1.0.1!
It seems like when using commands such as bun create vite
or the equivalent for next
, the process might be relying on the Node engine to generate the template. If Node/npm isn't properly installed or configured in win/wsl, this could potentially lead to issues. Additionally, I've noticed that when trying to run bunx --bun create-vite
to possibly utilize the bun
engine during template creation on my machine, there seems to happen the same issu, it freezes.
i could create svelte project after installing node js 18.x and git ,
but hot reload does not work.
WOW, the latest version v1.0.2 seems to solved this problem (at least on my machine).
bun upgrade
to 1.0.2 and you should be good to go. The react
template has been deprecated but it will walk you through the new template.
Can confirm that bun upgrade
to 1.0.2 resolves the issues. Thanks to everyone who contributed their input and experiences! I will be closing this.
@KirillTregubov I'm using the latest one and I'm using the ubuntu container, had the same problem. Can't continue
@KirillTregubov I'm using the latest one and I'm using the ubuntu container, had the same problem. Can't continue
Use nvm to install node in the Ubuntu container and give it another try.
@MaKTaiL thank you, it is solved via installing nvm and node.
I believe this has something to do with bun and/or inquirer. My code works well when building with bun using --target=node
and running the outfile with Node. When I build with bun and --target=bun
and then run with bun, it freezes after a few prompts.
macOS 13.6, node 18.7.1, bun 1.0.5, inquirer 9.2.11
Added repro on https://github.com/oven-sh/bun/issues/6323
Same issue using
bunx create-next-app
it freezes on the second question. Windows 11 (WSL, Ubuntu)
same happening now to me, even on linux native, I don't have installed npm or nodejs
Same happening to me:
node -v
: v18.19.0
or v20.10.0
bun -v
: 1.0.15
stuck on 2nd question while installing next.js in bun monorepo packages: screen recording.webm
Fixed using this command
# bun
bunx create-vite my-vue-app --template vue
from docs https://vitejs.dev/guide/#scaffolding-your-first-vite-project
$ bun create vite test-app
? Select a framework:
› - Use arrow-keys. Return to submit.
❯ Vanilla
Vue
React
Preact
Here it's as simple as that, if I have node installed on linux, I can select the options with the arrow keys and the enter key, and if I don't have node the command crashes and I can't even close it with CTRL+C.
Stuck, Node 20.10.0 bun 1.0.15 npm 10.2.3
ubuntu
Stuck, Node 20.10.0 bun 1.0.15 npm 10.2.3
ubuntu
@jjwallace please upgrade to Bun v1.0.18 by running bun upgrade
Stuck, Node 20.10.0 bun 1.0.15 npm 10.2.3 ubuntu
@jjwallace please upgrade to Bun v1.0.18 by running
bun upgrade
I tested it again and now it's working. Node no longer needs to be installed on wsl.
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
Windows version: KB5029263
What steps can reproduce the bug?
bunx create-next-app
OR
bun create vite
What is the expected behavior?
(tested with npx/npm, assume bun output is the same)
OR
What do you see instead?
OR
Additional information
It seems like interactive CLI prompts make my WSL terminal unresponsive when running scripts using
bunx
orbun create
as opposed to their npx/npm counterparts. The unresponsiveness can be characterized as inability to use input keys (arrows, enter) or exit keys (Ctrl+C). Most notably text prompts work perfectly fine (the first inputs in these scripts).This seems to be specific to WSL, but I did not test on Linux (tested working on Mac). #4646 seems to have the same issue.