Questions tagged [bun]

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

52 questions
1
vote
1 answer

Run Bun on Windows

Bun has been on every news aggregator and newsletter related to tech the past week due to its speed compared to create-react-app . I've tried to run it on Windows, but seems it is not supported yet. Does anyone know if they can run it on Windows?
Roy Awill
  • 132
  • 1
  • 13
0
votes
0 answers

How to change port on Grapql Yoga and BunJS

I have a very simple question that I can't find the answer to anywhere on the internet. I'm using the Graphql Yoga framework together with the bun runtime. On their website there is the following example: import { createSchema, createYoga } from…
Abner Matheus
  • 41
  • 1
  • 8
0
votes
1 answer

how to avoid manual import something into every .tsx and make all .tsx implicitly import that file

I'm trying to build a JS full stack framework so, as the 2nd step, I wanna import something globally. let me explain, I'm tryna use tsx without react, so I needed a lib to give me createElement function. so I used this lib type-html as tHTML. it…
user20684440
0
votes
0 answers

Property 'html' does not exist on type 'Context'

A simple app following the documentation instructions, but still get error: index.tsx import Elysia from "elysia"; import { html } from "@elysiajs/html"; import * as tHTML from "typed-html"; import staticPlugin from "@elysiajs/static"; import Home…
user20684440
0
votes
0 answers

Getting an error when trying to set up Turso database

I follow this tutorial to set up a web app using Bun, Htmx, Turso and Elysium. The problem is trying to set up the database. I created my account and put the database URL and auth token in .env file, but I couldn't get it to work, even with the…
0
votes
0 answers

Is it possible to pipe a Bun ReadableStream to a Node JS stream?

I want to pipe a Bun ReadableStream into a Node stream to process a CSV. Is there a way to convert a Bun ReadableStream to a Node.js compatible one? The docs for PapaParse shows this…
zino
  • 1,222
  • 2
  • 17
  • 47
0
votes
1 answer

Puppeteer: why is there a "Protocol error (Runtime.callFunctionOn): Target closed"?

I'm a newbie with Puppeteer but I try to use it to run my E2E tests. My JS runtime is Bun (v.0.6.9) and puppeteer should work. Below, a simple test throwing a puppeteer error I can't fix. describe('A test', async () => { const browser = await…
charnould
  • 2,480
  • 3
  • 19
  • 23
0
votes
0 answers

Why does importing an image crash the app for BunJS and NextJS?

I've an issue with BunJS + NextJS. I know, this JS runtime is in the initial phase but I wanted to test it due to operation speed. So I built the app with a template bun create next bun. Next, I added a picture to the project and called it in…
Amaranthus
  • 11
  • 5
0
votes
0 answers

Benchmarking on Github Codespace

I'm doing a benchmark for HTTP frameworks on Github Codespace. I don't have that much experience with benchmarking so I don't know if Github Codespace is actually stable or not for benchmarking. I did a few tests and the result is not that…
0
votes
0 answers

SyntaxError: Unexpected keyword 'export'

When trying to run a TS file using bun, I get the following: 1 | import NodeWallet from "./nodewallet"; 2 | import { isBrowser } from "./utils/common.js"; 3 | export { default as BN } from "bn.js"; 4 | export * as web3 from "@solana/web3.js"; 5 |…
SpaceMonkey
  • 4,143
  • 5
  • 38
  • 60
0
votes
0 answers

BunJs CLI scripting in Yaml

Is there a bun.js CLI tool that can read scripts written in Yaml? For example, in node.js, package.json is processed by npm, and script can be defined and run from the CLI, but json is not an easy-to-read format. In Deno, there is a specific tool…
0
votes
0 answers

Websocket sometimes does not receive message properly

I'm trying to use Bun to create an app that can interact with the Discord gateway. I tried the same code in node.js and it works properly, but in bun it only works sometimes. What I am doing is: Declare a paylod for identification. When the…
clapmemereview
  • 371
  • 1
  • 4
  • 14
0
votes
0 answers

SyntaxError: Exported binding 'jsx' needs to refer to a top-level declared variable

So I'm currently creating a basic application using Chakra and NextJS This is my _app.tsx import '../styles/globals.css' import type { AppProps } from 'next/app' import {ChakraProvider} from "@chakra-ui/provider"; function MyApp({ Component,…
varasat
  • 9
  • 2
0
votes
2 answers

Resolve JavaScript imports based on current runtime?

Is there a way of importing a JavaScript/TypeScript module based on which JavaScript runtime (Node, Deno, Bun) is being used? Something like: if (Bun) { import MyLib from "./mylib-bun.js"; } else if (Deno) { import MyLib from "./mylib-deno.js"; }…
Alex Shaw
  • 163
  • 1
  • 7
0
votes
1 answer

Remote IP in Bun.serve (no framework)

I'm using bun v0.1.7 (NOT nodejs), I'm trying the built-in basic http server without any other framework: export default { port: 3000, fetch(request: Request) { const remoteIp = request.headers.get('x-forwarded-for') || 'UNKNOWN'; …
Roberto
  • 8,586
  • 3
  • 42
  • 53