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

generalised issues with bun create command #4646

Closed
crushr3sist opened this issue Sep 9, 2023 · 39 comments
Closed

generalised issues with bun create command #4646

crushr3sist opened this issue Sep 9, 2023 · 39 comments
Labels
bug Something isn't working

Comments

@crushr3sist
Copy link

crushr3sist commented Sep 9, 2023

What version of Bun is running?

1.0.0

What platform is your computer?

Powershell Microsoft Windows NT 10.0.22621.0 x64
WSL2 Ubuntu 22.0 Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

bun create react
-> error: could not determine executable to run for package create-react
and
bun create vite

:~$ 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
to which it hangs. 

What is the expected behavior?

The handler from bun hangs when trying to create a vite fronted application. It locks out the whole terminal and no exit commands would work, I thoroughly waited for 20 minutes and no resolve.

@crushr3sist crushr3sist added the bug Something isn't working label Sep 9, 2023
@itsjavi
Copy link

itsjavi commented Sep 9, 2023

I have the same issue with bun create react on macOS 13 Ventura.
Is it because I have node installed? Idk. I am new to bun

@Jawkx
Copy link

Jawkx commented Sep 9, 2023

Same problem form me, pretty frustrated when the most basic scaffolding can't even work.

@Fiontan
Copy link

Fiontan commented Sep 9, 2023

Also on windows 10 wsl, bunx DOES NOT run for me, but bun x does, however, 👍 bun create react-ssr
1 | (function (bindingName){"use strict";if(bindingName==="constants")return @processBindingConstants;const issue={fs:3546,buffer:2020,natives:2254,uv:2891}[bindingName];if(issue)throw new Error(process.binding("${bindingName}") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue});@throwTypeError(process.binding("${bindingName}") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.)})
^
TypeError: process.binding("util") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.
at binding (:1:20)
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:68253
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:76016
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:56311
at t (/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:79269)
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:79828
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:80348
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:68101
at r (/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:1122)
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:1296

bun x create-next-app
1 | (function (bindingName){"use strict";if(bindingName==="constants")return @processBindingConstants;const issue={fs:3546,buffer:2020,natives:2254,uv:2891}[bindingName];if(issue)throw new Error(process.binding("${bindingName}") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue});@throwTypeError(process.binding("${bindingName}") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.)})
^
error: process.binding("fs") is not implemented in Bun. Track the status & thumbs up the issue: #3546
at binding (:1:20)
at 6748 (xxx/Data/global/node_modules/create-next-app/dist/index.js:461:25778)
at nccwpck_require (xxx/Data/global/node_modules/create-next-app/dist/index.js:461:123148)
at 6036 (/xxx/global/node_modules/create-next-app/dist/index.js:461:51341)
at nccwpck_require (xxx/Data/global/node_modules/create-next-app/dist/index.js:461:123148)
at 2127 (xxx/Data/global/node_modules/create-next-app/dist/index.js:461:50944)
at nccwpck_require (xxx/Data/global/node_modules/create-next-app/dist/index.js:461:123148)
at 2027 (xxx/Data/global/node_modules/create-next-app/dist/index.js:461:107796)
at nccwpck_require (/xxx/Data/global/node_modules/create-next-app/dist/index.js:461:123148)
at /xxx/Data/global/node_modules/create-next-app/dist/index.js:461:124017
error: "create-next-app" exited with code 1 (SIGHUP)

bun create react-ssr
1 | (function (bindingName){"use strict";if(bindingName==="constants")return @processBindingConstants;const issue={fs:3546,buffer:2020,natives:2254,uv:2891}[bindingName];if(issue)throw new Error(process.binding("${bindingName}") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue});@throwTypeError(process.binding("${bindingName}") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.)})
^
TypeError: process.binding("util") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.
at binding (:1:20)
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:68253
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:76016
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:56311
at t (/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:79269)
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:79828
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:80348
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:68101
at r (/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:1122)
at /tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:1296

@sonyarianto
Copy link
Contributor

refer to #4664

@Torniojaws
Copy link

Same thing on Linux:

$ lsb_release -d
Description:	Ubuntu 20.04.6 LTS
$ bun -v
1.0.0
$ bun create react test
error: could not determine executable to run for package create-react

@bdharrington7
Copy link

bdharrington7 commented Sep 10, 2023

Same on macOS:

brian@Darunia bun % bun --version
1.0.0
brian@Darunia bun % bun create react
error: could not determine executable to run for package create-react
brian@Darunia bun % sw_vers
ProductName:		macOS
ProductVersion:		13.4.1
ProductVersionExtra:	(c)
BuildVersion:		22F770820d

M1 Mac:

brian@Darunia bun % arch
arm64

@KlayHao
Copy link

KlayHao commented Sep 10, 2023

how-bun-create-works

What version of Bun is running?

1.0.0

What platform is your computer?

Powershell Microsoft Windows NT 10.0.22621.0 x64 WSL2 Ubuntu 22.0 Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

bun create react -> error: could not determine executable to run for package create-react and bun create vite

:~$ 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
to which it hangs. 

What is the expected behavior?

The handler from bun hangs when trying to create a vite fronted application. It locks out the whole terminal and no exit commands would work, I thoroughly waited for 20 minutes and no resolve.

@moneychien19
Copy link

Same in docker container (Linux amd64)

# bun --version
1.0.0
# bun create react ./bun-react-app
error: could not determine executable to run for package create-react

@itsjavi
Copy link

itsjavi commented Sep 10, 2023

pleate use command: bun create react-app your-project-name
@KlayHao

I don't think bun create react-app is having any benefit from bun, it's using npm and I get a package-lock.json file instead of a bun.lockb

image

@gjonhajdari
Copy link

I have the same issue running MacOS Ventura 13.5.1.

Running something like bun create react-app works but it's basically the same as running npx create-react-app.

gjonhajdari@chonatan ~ % bun -v
1.0.0
gjonhajdari@chonatan ~ % bun create react test-app
error: could not determine executable to run for package create-react

@ShimiShimson
Copy link

Same here on win 10 pro WSL Ubuntu
image

@PorthoGamesBR
Copy link

Same here, windows 11 Ubuntu WSL. Bunx doesnt seem to work too
bun create react
bun x create-react-app

@Marcoshsc
Copy link

Same here, windows 11 Ubuntu WSL. Bunx doesnt seem to work too bun create react bun x create-react-app

exact same error here. Using WSL Ubuntu.

@shafiqimtiaz
Copy link

shafiqimtiaz commented Sep 11, 2023

Same here on Ubuntu

Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

~/Desktop/Github/bun_react > bun -v
1.0.0
~/Desktop/Github/bun_react > bun create react
error: could not determine executable to run for package create-react

@nim-f
Copy link

nim-f commented Sep 11, 2023

Same om Mac Ventura 13.4.1

@arunattri26
Copy link

bun create react-app my-react-app --template typescript
It works successfully on Mac Ventura 11.6

@iliareshetov
Copy link

iliareshetov commented Sep 11, 2023

React:
bunx create-vite@latest bun-vite
Next.js:
bunx create-t3-app@latest bun-t3

@Yonben
Copy link
Contributor

Yonben commented Sep 11, 2023

@arunattri26 @iliareshetov using these don't get us the benefits of Bun. It uses non optimized templates afaik.

+1 for the issue on my side as well, Mac M1 on Ventura 13.5.1:

> bun create react app-name
error: could not determine executable to run for package create-react
> bun -v
1.0.0

@iliareshetov
Copy link

@arunattri26 @iliareshetov using these don't get us the benefits of Bun. It uses non optimized templates afaik.

+1 for the issue on my side as well, Mac M1 on Ventura 13.5.1:

> bun create react app-name
error: could not determine executable to run for package create-react
> bun -v
1.0.0

Hello @Yonben ,

It appears that there might be a slight misunderstanding. Using bunx create-vite@latest bun-vite actually provides the advantages of Bun. If you were to give it a try, you could easily confirm this.

On the other hand, it's worth noting that creating a React application through create-react-app is not the recommended method according to the official React documentation. You may want to refer to their guidance on Starting a New React Project.

@Yonben
Copy link
Contributor

Yonben commented Sep 11, 2023

@iliareshetov thanks for the answer!
However Bun guide shows we are required to manually change the vite script to get some advantages of Bun https://bun.sh/guides/ecosystem/vite.

They also add the following note at the start

While Vite currently works with Bun, it has not been heavily optimized, nor has Vite been adapted to use Bun's bundler, module resolver, or transpiler.

I mostly wish things were clearer then 😓

@artenlf
Copy link

artenlf commented Sep 11, 2023

@arunattri26 @iliareshetov using these don't get us the benefits of Bun. It uses non optimized templates afaik.
+1 for the issue on my side as well, Mac M1 on Ventura 13.5.1:

> bun create react app-name
error: could not determine executable to run for package create-react
> bun -v
1.0.0

Hello @Yonben ,

It appears that there might be a slight misunderstanding. Using bunx create-vite@latest bun-vite actually provides the advantages of Bun. If you were to give it a try, you could easily confirm this.

On the other hand, it's worth noting that creating a React application through create-react-app is not the recommended method according to the official React documentation. You may want to refer to their guidance on Starting a New React Project.

My terminal still freezing on variant selection.
I can select react template, however the next step is the variant selection.

For context, I'm on Win 10 WSL 2 Ubuntu 22.04.2 LTS

@iliareshetov
Copy link

@arunattri26 @iliareshetov using these don't get us the benefits of Bun. It uses non optimized templates afaik.
+1 for the issue on my side as well, Mac M1 on Ventura 13.5.1:

> bun create react app-name
error: could not determine executable to run for package create-react
> bun -v
1.0.0

Hello @Yonben ,
It appears that there might be a slight misunderstanding. Using bunx create-vite@latest bun-vite actually provides the advantages of Bun. If you were to give it a try, you could easily confirm this.
On the other hand, it's worth noting that creating a React application through create-react-app is not the recommended method according to the official React documentation. You may want to refer to their guidance on Starting a New React Project.

My terminal still freezing on variant selection. I can select react template, however the next step is the variant selection.

For context, I'm on Win 10 WSL 2 Ubuntu 22.04.2 LTS

Hello @artenlf,

I encountered a similar issue on a Windows machine, but I was able to resolve it by upgrading Git to the latest version. I suggest giving it a try!

@artenlf
Copy link

artenlf commented Sep 11, 2023

Hello @artenlf,

I encountered a similar issue on a Windows machine, but I was able to resolve it by upgrading Git to the latest version. I suggest giving it a try!

Thanks @iliareshetov. Still doesn't work even upgrading Git to version 2.42.0.

@PorthoGamesBR
Copy link

React: bunx create-vite@latest bun-vite Next.js: bunx create-t3-app@latest bun-t3

Vite freezes on the second input (The one to select between typescript and javascript). Didn't try next.js yet

@0xOlias
Copy link

0xOlias commented Sep 11, 2023

To anyone expecting bun create react to work:

When you run bun create react, Bun uses the create-react NPM package which is unfinished/broken. You're looking for create-react-app, which you can run using bun create react-app (this works on my machine).

The create-react package doesn't work with any of the package managers - npm create react and pnpm create react yield the same error as Bun (no binaries/executables found).

Also, use Vite, create-react-app is effectively deprecated.

@developerrowan
Copy link

I haven't been able to get any create installer to run on Ubuntu 22.04. Not Next, not Svelte, not Vite.

Svelte will run but when you get past the first input, it takes your inputs and displays them in the console. The program has effectively terminated.

Next will refuse to run due to "process.binding('fs') not being supported by Bun."

Vite will run but freeze once you get to the second question.

I was looking forward to trying the 1.0 release of Bun, but seems there's some issues to be worked out; in the meanwhile, can still benefit from the rest it has to offer!

@TreeOfLearning
Copy link

Even if vite did work, to my understanding we would not be getting the full power of Bun because it would not be using Bun's bundler and runtime. Right?

For react purposes (since this issue seems to have mostly devolved into vite/react project creation) it seems to me that the creators of Bun need to come up with their own react template that uses Bun end-to-end; otherwise, we're just trying to create a half-baked solution that doesn't really leverage the full benefits of Bun. (FWIW - the nextjs template also doesn't use Bun's bundler etc - the docs say so themselves!)

@Req
Copy link

Req commented Sep 12, 2023

To anyone expecting bun create react to work

The mechanism why it doesn't work is clear, but the issue is that this is how a lot of people start to try bun, because it's been said in multiple places that this is the way.

For example:

I saw both these thinking should I now finally check out Bun - so far, not a great experience 😬

[Edit] I have looked at the first page multiple times and just now noticed the deprecation message while editing this comment of mine. Neat that the text there is large but still it's not nearly obvious enough that this page is not to be trusted

@dezoito
Copy link

dezoito commented Sep 12, 2023

Same issue on
Linux Mint 21.1 (Ubuntu 22.04)

bun -v  
1.0.1

@trungsky
Copy link

trungsky commented Sep 12, 2023

Same issue on ubuntu 20.04

bun version 1.0.1

@colinhacks
Copy link
Contributor

colinhacks commented Sep 13, 2023

tldr: bun create react is not longer a valid command. We recommend using bun create vite or bun create react-app instead.

Previously, bun create used an internal list of sample projects that we maintained. We've since switched it to match npm and others, so bun create <template> equivalent to running bunx create-<template>. Since there's no create-react package on npm, the command fails.

If you run npm create react or yarn create react you'll see the same error.

No longer valid

$ bun create react

Use this instead

$ bun create vite
$ bun create react-app

@essexgit
Copy link

u

Colin - if it's a duplicate please post the issue track as you did with WSL freeze #4664

I still get the error on bun 1.01 - at the very least the instructions are incorrect. Not supporting ReactJS is a potential showstopper:

 bun create react
error: could not determine executable to run for package create-react
> bun create react ./hangman
error: could not determine executable to run for package create-react

@colinhacks
Copy link
Contributor

colinhacks commented Sep 14, 2023

It's not an issue — bun create react is an invalid command. If you run npm create react or yarn create react you'll see the same message.

Previously, bun create used an internal list of sample projects that we maintained. We've since switched it to match npm and others, so bun create <template> is equivalent to running bunx create-<template>. And because there's no create-react template on npm, the command fails.

We'll "solve" this issue by printing a more informative error message when bun create react is executed, this will land in 1.0.2 👍

#5248

@jcfj
Copy link

jcfj commented Sep 14, 2023

Is it possible that this is having some side-effects? (Apologies if my understanding of npm is broken here.)
image
image

@essexgit
Copy link

essexgit commented Sep 14, 2023

bun create react-app still calls create-react-app and fails:

execa/lib/errname: unable to establish process.binding('uv') 1 | (function (bindingName){"use strict";if(bindingName==="constants")return @p rocessBindingConstants;const issue={fs:3546,buffer:2020,natives:2254,uv:2891}[bindingName];if(issue)throw new Error(process.binding("${bindingName}") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue}`);@throwTypeError(`process.binding("${bindingName}") is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.`)}) ^
error: process.binding("uv") is not implemented in Bun. Track the status & thumbs up the issue: #2891
at binding (:1:20)
at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:0
at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779)
at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:128061
at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779)
at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:127427
at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779)
at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:126485
at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779)
at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:124600

1102 | res => {
1103 | if (res.statusCode === 200) {
1104 | let body = '';
1105 | res.on('data', data => (body += data));
1106 | res.on('end', () => {
1107 | resolve(JSON.parse(body).latest);
^
SyntaxError: JSON Parse error: Unrecognized token 'ߋ'
at /tmp/create-react-app@latest--bunx/node_modules/create-react-app/createReactApp.js:1107:22
at endReadableNT (node:stream:2387:52)
at processTicksAndRejections (:1:2602)
error: "create-react-app" exited with code 1 (SIGHUP)
`
The 'Vite freeze' is important, with npm the workaround is to run the bash terminal in vscode, where it becomes interactive, nut but 'bun create vite' freezes in vs code'
'npm create vite' does not freeze in vs code, either in windows or in WSL.

'bun create vite -- --template' in vscode creates a vite project without freezing.
'bun create vite -- --template' in mintty WSL default freezes, the same as in Git Bash for windows.

In summary:
$ bun create vite - freezes
$ bun create react-app - fails
$ bunx create-react-app - fails

$bun create vite -- --template' works in vscode bash terminal.
$ bunx create-react-app works in vscode bash

@Jarred-Sumner
Copy link
Collaborator

bun create react-app still calls create-react-app and fails:

execa/lib/errname: unable to establish process.binding('uv') 1 | (function (bindingName){"use strict";if(bindingName==="constants")return @p rocessBindingConstants;const issue={fs:3546,buffer:2020,natives:2254,uv:2891}[bindingName];if(issue)throw new Error(process.binding("${bindingName}") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/${issue});@throwTypeError(process.binding("${bindingName}");@throwTypeError(%60process.binding(%22$%7BbindingName%7D%22)) is not implemented in Bun. If that breaks something, please file an issue and include a reproducible code sample.`)}) ^ error: process.binding("uv") is not implemented in Bun. Track the status & thumbs up the issue: #2891 at binding (:1:20) at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:0 at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779) at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:128061 at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779) at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:127427 at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779) at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:126485 at n (/tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:33779) at /tmp/create-react-app@latest--bunx/node_modules/envinfo/dist/envinfo.js:1:124600

1102 | res => { 1103 | if (res.statusCode === 200) { 1104 | let body = ''; 1105 | res.on('data', data => (body += data)); 1106 | res.on('end', () => { 1107 | resolve(JSON.parse(body).latest); ^ SyntaxError: JSON Parse error: Unrecognized token 'ߋ' at /tmp/create-react-app@latest--bunx/node_modules/create-react-app/createReactApp.js:1107:22 at endReadableNT (node:stream:2387:52) at processTicksAndRejections (:1:2602) error: "create-react-app" exited with code 1 (SIGHUP) ` The 'Vite freeze' is important, with npm the workaround is to run the bash terminal in vscode, where it becomes interactive, nut but 'bun create vite' freezes in vs code' 'npm create vite' does not freeze in vs code, either in windows or in WSL.

'bun create vite -- --template' in vscode creates a vite project without freezing. 'bun create vite -- --template' in mintty WSL default freezes, the same as in Git Bash for windows.

In summary: $ bun create vite - freezes $ bun create react-app - fails

$bun create vite -- --template' works in vscode bash terminal.

This is a separate issue - that something in create-react-app is missing -- and it will be fixed in #5355

@essexgit
Copy link

Think you were ahead of my edit @Jarred-Sumner
bunx create-react-app works in vscode bash and mintty

@neoReuters
Copy link

Also, use Vite, create-react-app is effectively deprecated.

No it isn't. reactjs/react.dev#5487 (comment)

@untimated
Copy link

untimated commented Mar 27, 2024

if this does not work in stable way, why bun include this in official guides...
I'm new to Bun, and have been experimenting with the bun API's on the server side and see it a a promising true simplified zero cost abstraction of nodejs, however when i decided to delve bit about the frontend setup with bun it did not work. It could be nice in all-in one setup tool if we can entirely uses bunx/bun instead of alternating between bun/npm especially when working fullstack.

image
OS: Windows 11
Shell : Developer PowerShell v17.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests