oven-sh / bun

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

Bun is crashing when using elysia autoload #12605

Open FireSquid6 opened 3 months ago

FireSquid6 commented 3 months ago

How can we reproduce the crash?

Minimum reproduction: https://github.com/firesquid6/elysia-autoload-bun-crash

I am doing bun run server.ts to run the app.

I'm trying to use elysia autoload. The stack trace is from using Bun v1.1.17.

I figured the crash was just because I was on an old version of bun. I tried using bun v1.1.18 (unstable branch of nixpkgs), and I am getting the same error.

Relevant log output

No response

Stack Trace (bun.report)

Bun v1.1.17 (bb66bba) on linux x86_64 [RunCommand]

Segmentation fault at address 0x0000001A

github-actions[bot] commented 3 months ago

@FireSquid6, the latest version of Bun is v1.1.20, but this crash was reported on Bun v1.1.17.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade
FireSquid6 commented 3 months ago

hold on bun v1.1.20 is not out on nixpkgs so I gotta do some annoying manual stuff. I'll give another comment about that output.

FireSquid6 commented 3 months ago

Yup. Crash still happening on v1.1.20. Here's the stack trace there:

Bun v1.1.20 (ae19489) on linux x86_64 [AutoCommand]

Segmentation fault at address 0x0000001A

paperdave commented 3 months ago

thanks for the reproduction. it happens instantly for me. i've seen convertReplacingInvalidSequences floating around in a lot of other stack traces but i didnt have a good repro.

bili-jing commented 3 months ago

I have the same problem. Can this be fixed with bun, or does it require elysia-autoload?

paperdave commented 3 months ago

yeah, this is a bug in bun

FireSquid6 commented 3 months ago

There's currently some discussion on the elysia discord about this very issue. #12606 could possibly be related.

bili-jing commented 3 months ago

Elysia can be reduced to 1.0.27

kravetsone commented 3 months ago

HI! Im elysia-autoload maintainer

The most interesting thing is that everything works on Windows... but when i switched to WSL, i got the same error

kravetsone commented 3 months ago

i can fix it))

kravetsone commented 3 months ago

@paperdave @FireSquid6 @bili-jing please try again with elysia-autoload@v1.1.0

kravetsone commented 3 months ago

this caused a crash in two of my elysia plugins when we upgraded elysia to version 1.1...

How can I fix this? just add the export type when exporting the type... explain why....

FireSquid6 commented 3 months ago

I'm still getting an error (not bun crash though) when using autoload version 1.1.0. This one could be my bad though. Here's what I'm attempting to do:

https://github.com/FireSquid6/elysia-autoload-bun-crash/tree/kravetsone-fix

Although this discussion may need to move to the elysia-autoload repo instead of here as long as it isn't crashing.

kravetsone commented 3 months ago

Я все еще получаю ошибку (но не крах Bun) при использовании версии автозагрузки 1.1.0. Но это может быть моей ошибкой. Вот что я пытаюсь сделать:

https://github.com/FireSquid6/elysia-autoload-bun-crash/tree/kravetsone-fix

Хотя это обсуждение, возможно, следует перенести в репозиторий elysia-autoload, а не сюда, если только он не даст сбой.

latest elysia & autoload?

which error?

paperdave commented 3 months ago

the fact that this crashes bun is automatically a bug in bun that we will have to fix eventually, however it is nice to see a workaround in elysia.

kravetsone commented 3 months ago

the fact that this crashes bun is automatically a bug in bun that we will have to fix eventually, however it is nice to see a workaround in elysia.

yeah i fix it but we need to find "why" it cause... i just export types with export type * from instead of export * from for two package and it solve the problem

idk why it cause only with elysia@1.1 ....