Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Astro #3746

Closed
birkskyum opened this issue Jul 22, 2023 · 19 comments
Closed

Support Astro #3746

birkskyum opened this issue Jul 22, 2023 · 19 comments
Assignees
Labels
tracking An umbrella issue for tracking big features

Comments

@birkskyum
Copy link
Collaborator

birkskyum commented Jul 22, 2023

Astro GitHub - Website

What version of Bun is running?

0.7.0 (canary, hash 3418feb)

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

  • bun --bun x create-astro@latest
  • Step through installer, like:
    • empty template
    • no dependency install
    • no typescript
    • no git repo
  • bun i
  • bun --bun run dev

Can also be reproduced by following the official guide here:
https://docs.astro.build/en/recipes/bun/

What is the expected behavior?

Server start

> astro dev

  🚀  astro  v2.9.1 started in 42ms
  
  ┃ Local    http://localhost:3000/
  ┃ Network  use --host to expose

What do you see instead?

➜ bun --bun run dev
$ astro dev
error: script "dev" exited with code 11 (SIGSEGV)

Additional information

Blocked by

@birkskyum birkskyum added the bug Something isn't working label Jul 22, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Jul 23, 2023

Debug logs
/Users/jarred/Build/astroy/node_modules/astro/astro.js
Launched process 74290
[SYS] read(3, 4096) = 4096 (0.032ms)
[SYS] close(3)
[JSC] boot (src/bun_js.zig:135)
[JSC] initialize (src/bun.js/bindings/bindings.zig:5703)
[fs] open(/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 4 } }
[fs] readdir(4, /) = 20
[fs] open(/Users/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 5 } }
[fs] readdir(5, /Users/) = 4
[fs] open(/Users/jarred/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 6 } }
[fs] readdir(6, /Users/jarred/) = 170
[fs] open(/Users/jarred/Build/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[fs] readdir(7, /Users/jarred/Build/) = 373
[fs] open(/Users/jarred/Build/astroy/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 8 } }
[fs] readdir(8, /Users/jarred/Build/astroy/) = 9
[fs] openat(8, /Users/jarred/Build/astroy/package.json) = 9
[fs] stat(9) = 223
[fs] pread(9, 223) = 223
[SYS] close(9)
[fs] openat(8, /Users/jarred/Build/astroy/tsconfig.json) = 9
[fs] stat(9) = 496
[fs] pread(9, 496) = 496
[SYS] close(9)
[fs] open(/Users/jarred/Build/astroy/node_modules/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 9 } }
[fs] readdir(9, /Users/jarred/Build/astroy/node_modules/) = 316
[fs] open(/Users/jarred/Build/astroy/node_modules/astro/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 10 } }
[fs] readdir(10, /Users/jarred/Build/astroy/node_modules/astro/) = 20
[fs] openat(10, /Users/jarred/Build/astroy/node_modules/astro/package.json) = 11
[fs] stat(11) = 7249
[fs] pread(11, 7249) = 7249
[SYS] close(11)
[SYS] close(4)
[SYS] close(5)
[SYS] close(6)
[SYS] close(7)
[SYS] close(8)
[SYS] close(9)
[SYS] close(10)
[CPP] GlobalObject__create
[CPP] JSValue__makeWithNameAndPrototype
[CPP] JSGlobalObject__vm
[CPP] VM__holdAPILock
[JSC] ensureWaker (src/bun.js/event_loop.zig:772)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[CPP] JSModuleLoader__loadAndEvaluateModule
Loader [fetch] bun:main
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] createLatin1 (src/string.zig:324)
loader [parsing] bun:main
Loader [resolve] /Users/jarred/Build/astroy/node_modules/astro/astro.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/astro/astro.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/astro/astro.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/astro/astro.js) = 6
[fs] stat(6) = 2264
[fs] pread(6, 2264) = 2264
[fs] open(/Users/jarred/Build/astroy/node_modules/ci-info) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[fs] readdir(7, /Users/jarred/Build/astroy/node_modules/ci-info/) = 7
[fs] openat(7, /Users/jarred/Build/astroy/node_modules/ci-info/package.json) = 8
[fs] stat(8) = 1023
[fs] pread(8, 1023) = 1023
[SYS] close(8)
[SYS] close(7)
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
loader [parsing] /Users/jarred/Build/astroy/node_modules/astro/astro.js
Loader [import] ./dist/cli/index.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] readdir(6, /Users/jarred/Build/astroy/node_modules/astro/dist/cli/) = 15
[fs] open(/Users/jarred/Build/astroy/node_modules/astro/dist/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 6 } }
[fs] readdir(6, /Users/jarred/Build/astroy/node_modules/astro/dist/) = 30
[fs] open(/Users/jarred/Build/astroy/node_modules/astro/dist/cli) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[SYS] close(6)
[SYS] close(7)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/astro/dist/cli/index.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/astro/dist/cli/index.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/astro/dist/cli/index.js) = 6
[fs] stat(6) = 4704
[fs] pread(6, 4704) = 4704
[fs] open(/Users/jarred/Build/astroy/node_modules/kleur) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[fs] readdir(7, /Users/jarred/Build/astroy/node_modules/kleur/) = 9
[fs] openat(7, /Users/jarred/Build/astroy/node_modules/kleur/package.json) = 8
[fs] stat(8) = 990
[fs] pread(8, 990) = 990
[SYS] close(8)
[SYS] close(7)
[fs] open(/Users/jarred/Build/astroy/node_modules/yargs-parser) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[fs] readdir(7, /Users/jarred/Build/astroy/node_modules/yargs-parser/) = 6
[fs] openat(7, /Users/jarred/Build/astroy/node_modules/yargs-parser/package.json) = 8
[fs] stat(8) = 2518
[fs] pread(8, 2518) = 2518
[SYS] close(8)
[SYS] close(7)
[fs] open(/Users/jarred/Build/astroy/node_modules/yargs-parser/build/) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[fs] readdir(7, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/) = 2
[fs] open(/Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib) = fs.IterableDir{ .dir = fs.Dir{ .fd = 8 } }
[fs] readdir(8, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/) = 5
[SYS] close(7)
[SYS] close(8)
[fs] readdir(7, /Users/jarred/Build/astroy/node_modules/astro/dist/core/) = 32
[fs] open(/Users/jarred/Build/astroy/node_modules/astro/dist/core) = fs.IterableDir{ .dir = fs.Dir{ .fd = 7 } }
[SYS] close(7)
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
loader [parsing] /Users/jarred/Build/astroy/node_modules/astro/dist/cli/index.js
Loader [resolve] /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/index.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] /Users/jarred/Build/astroy/node_modules/astro/dist/core/constants.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs) = 6
[fs] stat(6) = 1645
[fs] pread(6, 1645) = 1645
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/index.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/index.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/index.js) = 6
[fs] stat(6) = 2508
[fs] pread(6, 2508) = 2508
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/astro/dist/core/constants.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/astro/dist/core/constants.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/astro/dist/core/constants.js) = 6
[fs] stat(6) = 295
[fs] pread(6, 295) = 295
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
loader [parsing] /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs
loader [parsing] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/index.js
Loader [resolve] node:util
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] node:path
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] node:fs
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
loader [parsing] /Users/jarred/Build/astroy/node_modules/astro/dist/core/constants.js
Loader [fetch] node:util
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] refCountedStringWithWasNew__anon_303760 (src/bun.js/javascript.zig:1136)
[JSC] createExternal (src/string.zig:410)
[JSC] ref (src/string.zig:107)
[JSC] ref (src/string.zig:107)
Loader [fetch] node:path
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] refCountedStringWithWasNew__anon_303760 (src/bun.js/javascript.zig:1136)
[JSC] createExternal (src/string.zig:410)
[JSC] ref (src/string.zig:107)
[JSC] ref (src/string.zig:107)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js) = 6
[fs] stat(6) = 2084
[fs] pread(6, 2084) = 2084
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser.js) = 6
[fs] stat(6) = 46827
[fs] pread(6, 46827) = 46827
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] node:fs
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] refCountedStringWithWasNew__anon_303760 (src/bun.js/javascript.zig:1136)
[JSC] createExternal (src/string.zig:410)
[JSC] ref (src/string.zig:107)
[JSC] ref (src/string.zig:107)
loader [parsing] node:util
Loader [resolve] node:util/types
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
loader [parsing] node:path
loader [parsing] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js
loader [parsing] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser.js
Loader [resolve] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser-types.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
loader [parsing] node:fs
Loader [resolve] node:events
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] node:fs/promises
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] node:stream
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [link] /Users/jarred/Build/astroy/node_modules/astro/astro.js
Loader [link] bun:main
Loader [evaluate] /Users/jarred/Build/astroy/node_modules/astro/astro.js
Loader [evaluate] bun:main
Loader [fetch] node:util/types
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/tokenize-arg-string.js) = 6
[fs] stat(6) = 1092
[fs] pread(6, 1092) = 1092
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser-types.js
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] Bun__runVirtualModule (src/bun.js/module_loader.zig:1651)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] Bun__transpileFile (src/bun.js/module_loader.zig:1600)
[ModuleLoader] transpileFile: /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser-types.js
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[fs] openat(0, /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser-types.js) = 6
[fs] stat(6) = 425
[fs] pread(6, 425) = 425
[JSC] createLatin1 (src/string.zig:324)
[SYS] close(6)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] node:events
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] refCountedStringWithWasNew__anon_303760 (src/bun.js/javascript.zig:1136)
[JSC] createExternal (src/string.zig:410)
[JSC] ref (src/string.zig:107)
[JSC] ref (src/string.zig:107)
Loader [fetch] node:fs/promises
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
Loader [fetch] node:stream
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
[JSC] refCountedStringWithWasNew__anon_303760 (src/bun.js/javascript.zig:1136)
[JSC] createExternal (src/string.zig:410)
[JSC] ref (src/string.zig:107)
[JSC] ref (src/string.zig:107)
loader [parsing] node:util/types
loader [parsing] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
loader [parsing] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser-types.js
loader [parsing] node:events
loader [parsing] node:fs/promises
loader [parsing] node:stream
Loader [resolve] bun:events_native
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [resolve] node:string_decoder
[JSC] resolve (src/bun.js/bindings/exports.zig:69)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] ref (src/string.zig:107)
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[JSC] deref (src/string.zig:95)
[JSC] deref (src/string.zig:95)
Loader [fetch] bun:events_native
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
Loader [fetch] node:string_decoder
[JSC] Bun__fetchBuiltinModule (src/bun.js/module_loader.zig:1574)
loader [parsing] bun:events_native
loader [parsing] node:string_decoder
Loader [link] /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs
Loader [link] node:util/types
Loader [link] node:util
Loader [link] node:path
Loader [link] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/string-utils.js
Loader [link] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
Loader [link] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser-types.js
Loader [link] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/yargs-parser.js
Loader [link] node:events
Loader [link] node:fs/promises
Loader [link] bun:events_native
Loader [link] node:string_decoder
Loader [link] node:stream
Loader [link] node:fs
Loader [link] /Users/jarred/Build/astroy/node_modules/yargs-parser/build/lib/index.js
Loader [link] /Users/jarred/Build/astroy/node_modules/astro/dist/core/constants.js
Loader [link] /Users/jarred/Build/astroy/node_modules/astro/dist/cli/index.js
Loader [evaluate] /Users/jarred/Build/astroy/node_modules/kleur/colors.mjs
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
[CPP] JSGlobalObject__bunVM
[CPP] JSGlobalObject__bunVM
[JSC] ascii (src/bun.js/bindings/bun-simdutf.zig:105)
loader [parsing] node:events
Loader [evaluate] node:events
Stop reason: EXC_BAD_ACCESS (code=1, address=0x18)

Stack trace:

JSC::JSModuleNamespaceObject::getOwnPropertySlotCommon(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) (@JSC::JSModuleNamespaceObject::getOwnPropertySlotCommon(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&):118)
JSC::LLInt::performLLIntGetByID(JSC::BytecodeIndex, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&, JSC::GetByIdModeMetadata&) (@JSC::LLInt::performLLIntGetByID(JSC::BytecodeIndex, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&, JSC::GetByIdModeMetadata&):793)
llint_slow_path_get_by_id (@llint_slow_path_get_by_id:112)
llint_entry (@llint_entry:11803)

@birkskyum
Copy link
Collaborator Author

@Jarred-Sumner , how did you make a debug log and stack trace?

I tried adding a bunfig.toml with logLevel = "debug", and running with VSCode debug etc., to get more information, but neither made a difference.

@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Jul 23, 2023

Using a debug build of Bun, I set BUN_DEBUG_ALL=1 which logs everything that Bun internally logs. These debug logs are only available in debug builds because they are very slow to print and there are lots and lots of them

I also set BUN_JSC_dumpModuleLoadingState=1 which is a JSC flag that prints out ESM loading state changes. This one works in release builds.

Also, I ran bun with lldb which lets us see the native stack trace. It will need a build of bun with debug symbols, such as bun-profile or the debug build

@Jarred-Sumner Jarred-Sumner added tracking An umbrella issue for tracking big features and removed bug Something isn't working labels Jul 24, 2023
@kanashimia
Copy link

kanashimia commented Aug 3, 2023

bun -b run build no longer immediately segfaults after #3814
It now errors out with (using blog example)

[astro:jsx] jsx is not a function. (In 'jsx({}, { throwIfNamespace: !1, runtime: "automatic", importSource: "astro" })', 'jsx' is undefined)

And sometimes segfaults :)

bun -b run dev even seems to work (until you change some file and it segfaults)

@paperdave
Copy link
Member

I've noticed that extremely simple projects work in astro dev, but anything big will segfault instantly. It could be something with how we're handling strings with the fs module but I'm not entirely sure yet (in debug build of bun it always fails an assertion)

Maybe we can get this working by the next release, I'm not sure how many more issues will show up after we fix the string segfaults.

@birkskyum
Copy link
Collaborator Author

birkskyum commented Aug 13, 2023

@paperdave , for some initial support, it seems like the jsx transform pr to Astro did the trick! At least for astro@2.10.4 and up

@paperdave
Copy link
Member

it appears that way but are large repos like Astro's docs actually building? i was experiencing consistent segfaults that didn't make me comfortable saying "it works"

@birkskyum
Copy link
Collaborator Author

birkskyum commented Aug 13, 2023

The only issue I find in the docs repo is when I hit a page that breaks with:

undefined is not an object (evaluating 'astroInfo.version')

because of this:

const astroInfo = await cachedFetch(`https://registry.npmjs.org/${pkg}/latest`).then((res) =>
res.json()
);
const latestAstroVersion = "astroInfo.version";

but no segfaults for the bun --bun run start

the whole site works if this version number is just added manually const latestAstroVersion = "2.10.7";

@birkskyum birkskyum reopened this Aug 13, 2023
@birkskyum
Copy link
Collaborator Author

I find that there is an issue with the bun --bun run build though:

error: script "build" exited with code 11 (SIGSEGV)

@birkskyum
Copy link
Collaborator Author

birkskyum commented Aug 13, 2023

And in the bun --bun run test that use Vitest, which is a separate issue #4145

4%bun --bun run test
$ vitest
SyntaxError: Import named 'Console' not found in module 'node:console'.
error: script "test" exited with code 1 (SIGHUP)

@paperdave
Copy link
Member

I find that there is an issue with the bun --bun run build though:

error: script "build" exited with code 11 (SIGSEGV)

this is what i was referring to. this happens in development sometimes too if you mess with it enough. there can also be crashes in canvaskit-wasm. maybe these are separate issues than the goal "make astro work" but i would only feel better closing this after some larger sites work

@birkskyum
Copy link
Collaborator Author

birkskyum commented Aug 25, 2023

Update bun 0.8.1:

bun --bun run dev
bun --bun run build
bun --bun run preview
bun --bun x create-astro@latest
bun --bun run test

@birkskyum
Copy link
Collaborator Author

birkskyum commented Aug 30, 2023

Astro 3.x fresh out of the gate. Doesn't seem to change the situation. Can't run the Astro repo though, because it rely on pnpm workspaces. Also astro 3 uses sharp for image optimization.

@naturalethic
Copy link

VSCode Astro Language Server has trouble locating svelte components after bun install.

I'm not sure the best place to put this, but I found that because bun doesn't install peer dependencies, the typescript package is not installed in the project, which causes false warnings in VSCode. Took me a long time to sort this out, perhaps a note could be placed on the bun astro doc.

sanman1k98 added a commit to sanman1k98/www that referenced this issue Sep 9, 2023
Add a "trustedDependencies" property containing `sharp` (the default
image processing service for Astro) because it uses custom install
scripts which makes it incompatible with a normal `bun install`.

For security reasons, Bun **will not** run the lifecycle scripts of
installed dependencies.

The "trustedDependencies" property enables developers to explicitly
define an allowlist of packages that are allowed to run scripts.

Steps for this workaround:
- add the "trustedDependencies" property to the `package.json`
- `rm -rf node_modules bun.lockb`
- `bun install`

See these issues and PRs:
- oven-sh/bun#4549
- oven-sh/bun#2073
- oven-sh/bun#3746
@ghiscoding
Copy link

ghiscoding commented Oct 16, 2023

VSCode Astro Language Server has trouble locating svelte components after bun install.

I'm not sure the best place to put this, but I found that because bun doesn't install peer dependencies, the typescript package is not installed in the project, which causes false warnings in VSCode. Took me a long time to sort this out, perhaps a note could be placed on the bun astro doc.

@naturalethic I saw PR #6396 few days ago, I'm not sure if it's shipped yet but that will probably help

@birkskyum
Copy link
Collaborator Author

birkskyum commented Jan 4, 2024

@naturalethic , do you still have issues with the language server with the latest version of bun (bun update --canary)?

@nektro
Copy link
Member

nektro commented May 15, 2024

anything left blocking this from being marked completed? all the package.json scripts from default install work as intended and pnpm workspaces are tracked elsewhere. I see mention of a test script in the thread but that is no longer included in the default package.json.

@nektro nektro self-assigned this May 15, 2024
@birkskyum
Copy link
Collaborator Author

birkskyum commented May 15, 2024

It's quite common at this point to use vitest with Astro, so it would cause friction for big fraction of people if that's not supported. I think that's the only thing remaining. It has its own ticket tough, so it can be tracked there with this ticket closed.

@nektro
Copy link
Member

nektro commented May 15, 2024

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracking An umbrella issue for tracking big features
Projects
None yet
Development

No branches or pull requests

7 participants