Questions tagged [bun]

Bun is a JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.

52 questions
2
votes
4 answers

Can Bunjs be used as a backend server?

Now we can start a react App with bun as a server Can we use Bunjs as complete backend server? For Example, Can bun run this code? const express = require('express') const app = express() app.get('/', (req, res) => { res.send('hello…
Mohamed Kamel
  • 282
  • 2
  • 8
2
votes
2 answers

What is the build command for react app created with bun js?

Installed bun version is bun -v 0.1.2 I created a react app with the following command bun create react my-bun-app To run it I am using the following command cd my-bun-app bun dev Now I want to know what is the build command for building the…
2
votes
1 answer

Configure bun with Azure Devops artifacts package registry

In my bunfig.toml file I have: [install.scopes] "@company" = {url = "https://company.pkgs.visualstudio.com/_packaging/Web/npm/registry", username = "company", password = "BASE_64_ENCODED_PAT"} Unfortunately I get an error with SegmentationFault at…
Jamie
  • 3,105
  • 1
  • 25
  • 35
2
votes
3 answers

"'bun' not found" error in Windows with WSL

First, I run this command on my windows machine $curl https://bun.sh/install | bash Output of the above first command Second, I run this command to set this path in the file $nano ~/.bashrc Output of the above second command After setting these…
2
votes
3 answers

how to use tailwind with bun

I'm creating a react app using bun.sh. But I also use tailwindcss for styling and tailwind has no official solution for bun. How can use these two together? I know bun is not ready for production but I'm still looking for a solution if its possible.
1
vote
0 answers

Why does the nuxt loader come up instead of the response?

I just make the nuxt 3 app with graphql. Although in development mode everything works fine, in production there is such a problem: instead of response to any request to api (and not only) comes the nuxt loader code. See the screenshots In bun run…
1
vote
1 answer

Node fetch implementation seems to differ from Deno and Bun causing a website to return no response?

I am trying to fetch the html for my universities login page. When using the built-in fetch in node I get the html response as expected. when using Deno and Bun however the response is nothing. Deno throws an EOF error. Bun prints nothing. Python,…
1
vote
0 answers

How to Enable Hot Reloading with Bun in a React Application?

I've been developing a React application and decided to use Bun as my JavaScript runtime for its great performance claims. However, I seem to have stumbled upon an issue regarding hot reloading of my React application. I start my application using…
1
vote
0 answers

How to import @types definitions with bun js?

Bun works fine with TypeScript libraries, but I can't get it working with packages that require @types, such as jsonwebtoken. For example for the following code import {sign} from "jsonwebtoken"; const token = sign({ name: "name" },…
Huakun Shen
  • 312
  • 2
  • 9
1
vote
0 answers

Bun Build giving me index.html with blank pages

So I was trying to create a webpage and wanted to do that in bun. Here is the structure of my webpage: The issue that I'm facing right now is that, if I try to start the webpage using bun start then the webpage works flawlessly, I'm able to…
1
vote
1 answer

Migrate yarn.lock dependencies to bun.lockb file

I want to read yarn.lock file and generate bun.lockb from that with the same dependencies to be used in bun install, without this bun is creating the deps based on package.json and is big projects (specially typescript projects) it brings lost of…
SayJeyHi
  • 1,559
  • 4
  • 19
  • 39
1
vote
1 answer

Using an in-memory db with pgx and bun (Golang)

I have just started using pgx and bun with Golang and I need to start testing my repository implementation. I am struggling to understand if I can use an embedded postgres db and what would be the best choice. Any suggestion is more than…
panza
  • 1,341
  • 7
  • 38
  • 68
1
vote
0 answers

Julia being outperformed (20 times) by node

So I made a JS file to calculate a list of number below 10 that go through certain properties. // Config // const maxNum = 30; //The largest number that can be used (even) const maxLength = maxNum; // The max length of a group // Default vars const…
BelMat
  • 93
  • 8
1
vote
1 answer

Run js or ts file with `bun js` in vscode's code runner extension

How can I run .js or .ts file with bun in VS Code (from Code Runner Extension). I have only bun JS as JavaScript Runtime in my Computer ( I don't have nodejs in my computer). Even if I download nodejs then how can I run .js file with bun js in…
1
vote
1 answer

Bun js SegmentationFault at 188

I am trying to run below command on my existing repo which has registry setup in the .npmrc bun install -y The -y flag is for generating yarn v1 lockfile It result into following error: SegmentationFault at 188 How to setup the .rc file for bun to…
Akshay Gundewar
  • 864
  • 11
  • 30