DEV Community

Cover image for Create a react app with bun

Create a react app with bun

Ashirbad Panigrahi on July 16, 2022

Want to use bun for your next react projects? Install bun First run the following command to check bun is installed or not...
Collapse
 
foxy4096 profile image
Foxy4096

Can I also create next js app with bun?

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Here it is the step by step guide for creating nextjs app with bun

dev.to/ashirbadgudu/lets-create-a-...

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Yes you can I will post on this topic really soon.

Collapse
 
pandademic profile image
Pandademic

Great article.

Does bun support other frameworks(I have svelte in mind) too?

Thanks again.

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

It is supports nextjs, react but I'm not sure about svelte but I will definitely look into it.

Collapse
 
pandademic profile image
Pandademic

Thanks!

Collapse
 
dawosch profile image
Dawosch • Edited

bun is on my β€žtry nextβ€œ list. But i don’t understand why all package manager needs this β€žrunβ€œ word.
I want to execute scripts like:

bun dev
bun start
bun build
…

Collapse
 
frontendwizard profile image
Juliano Rafael

the reason is to avoid clashes or confusion with the cli commands. if you had bun dev, just by looking at the command you don't know if it's a command from the cli itself or a script from the package.json. with run you know what's a script and what's a cli command.

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Indeed

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Yes I also want to see this, but for now you can use some certain commands in this way ex:

bun start
Enter fullscreen mode Exit fullscreen mode
Collapse
 
khushis26 profile image
Khushi

This is really cool thanks for this

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Happy to hear it

Collapse
 
msbala007 profile image
msbala007

Could I use npm packages?

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Yes you can ex:

bun add @ashirbad/js-core                     
Enter fullscreen mode Exit fullscreen mode
Collapse
 
hamidabdulmalik profile image
Hamid Abdulmalik Al-Hassan

This is really great, how about bun for Vite? Once again, thank you.

Collapse
 
nuralam profile image
nuralam

why this happened?
Image description

Collapse
 
harryhighpants profile image
Harry

Since bun can directly execute .ts and .tsx files we can use the typescript template to setup a typescript project instead of js:
bun create react-app my-app --template typescript

Collapse
 
arup2079 profile image
Info Comment hidden by post author - thread only accessible via permalink
arup saha chowdhury

Spy Camera
Β TECHNOVIEW 64GB Inbuilt Wireless Spy Camera WiFi Mini Camera Video Wireless CamerasWiFi Watch Live View Nanny Camera Users 1080P HD Cameras Video Audio Recording...Β -App V380 Pro.

device
buy now

Media
A hidden spy camera can shoot HD 1080P video and pixel photos. It is equipped with the latest CMOS sensor, it can show excellent image quality better than other cameras. Provide you with h-definition vision! Once your iPhone or Android phone is configured with router Wi-Fi (Only2.4GHz).Β Then you can view live video on the App remotely from anywhere in the world.

Hidden spy camera (1.1*1.1*1.1 inches) mini camera, and can be easily stored in various environments. Take videos and photos without attracting any attention. Small and exquisite equipment, it can be monitored even when power outages, HD at night, alarm reminder, easy to set up, HD picture quality, and mobile monitoring.

90Β° wide viewing angle helps you see more of what's happening, it doesn't emit light to attract any attention while shooting in the dark, it provides more accurate image quality than other cameras, and once the mini camera detects motion, it automatically saves the relevant video to SD card (64GB Sd Card Included).

Wireless camera built-in quality 300mAh rechargeable battery, this camera can work 60 Minutes without charging, 24/7 uninterrupted working while charging.The camera system Remote monitoring by APP (Only 2.4GHz WiFi), set the β€œWiFi Config” in the APP Device Setting for remote viewing. Just insert the SD card of 64GB (included with the camera) turn on recording and it can save the recording with the SD card.

ift.tt/toFIeby
July 24, 2022 at 12:46AM

Collapse
 
13rtk profile image
Uaena_Alex_John

Nowadays, the react template has been deprecated, the correct command should be:

bun create react-app ./react-app
Enter fullscreen mode Exit fullscreen mode
Collapse
 
rahul_yadav_a4d9d43d1a966 profile image
Rahul Yadav

Yes, I tried this one.

Collapse
 
santokhan profile image
Santo Khan

Bro, it is slower than npm. Rather than we can use

bun create vite
Enter fullscreen mode Exit fullscreen mode
Collapse
 
preyashhojiwala profile image
Preyash Hojiwala

HELP

  • bun create react test
  • bun create react ./test Tried both commands, not workin, usin win10 vscode wsl
Collapse
 
xiaoxinsky profile image
xiaoxin

What are advantages over nodejs?

Collapse
 
21vekit profile image
21VEKIT

Image description

not work

Collapse
 
mrgoonie profile image
Goon Nguyen

should be bun create react-app <app-name>

Collapse
 
navidj1360 profile image
Navid jalilian

what about windowsπŸ˜’

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

Did you facing any issues with windows? You can share the issue little bit more

Collapse
 
xaiyang99 profile image
xaiyang99

I have a problem when bun start, bun dev. run on ubuntu in window
send() error: Invalid argument
500 GET / as application/octet-stream

Some comments have been hidden by the post's author - find out more