oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.27k stars 2.77k forks source link

Can't execute build bundle when using html library from @elysiajs/html #4849

Open DrUse1 opened 1 year ago

DrUse1 commented 1 year ago

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

Darwin 22.1.0 arm64 arm

What steps can reproduce the bug?

setup the Elysia default project, add the html library and using this code for example :

import { Elysia } from "elysia";
import { html } from "@elysiajs/html";

const app = new Elysia()
  .use(html())
  .get("/", () => "<div>hello</div>")
  .listen(8080);

console.log(
  `🦊 Elysia is running at http://${app.server?.hostname}:${app.server?.port}`
);

What is the expected behavior?

It should execute fine and open the server on port 8080

What do you see instead?

Random errors :

During build :

image

And when executing the index.js bundle :

image

Additional information

No response

Adnanear commented 1 year ago

I've got the same problem!

myango1 commented 9 months ago

Bun -v 1.0.25, MAC Worked for me but I had a couple issues. First I had to chown -R USER the project folder, installed with bun add the imports

import { Elysia } from 'elysia'; import { html } from "@elysiajs/html";

const app = new Elysia() .use(html()) .get("/", () => `

hello
<!DOCTYPE html>

hello App
hello
`) app.listen({ port: 3000 }, () => { console.log(`Server running on http://localhost:3000`); }); If I don't chown the error is as such, but misleading, Copilot and ChatGPT4 failed on this, lack of bun resources. error: An unknown error ocurred, possibly due to low max file descriptors (Unexpected) Current limit: 256 To fix this, try running: ulimit -n 2147483646 If that still doesn't work, you may need to run: sudo launchctl limit maxfiles 2147483646 (I didn't do this, CHOWN)