# Create wasm file
touch a.zig
zig build-exe a.zig -target wasm32-freestanding -fno-entry -femit-bin=a.wasm
# Create bun file
echo 'import a from "./a.wasm";' > a.js
echo 'console.log(a);' >> a.js
Crashes:
bun build --target=bun a.js
Outputs the filename, rather than a WebAssembly.Module as documentation would suggest:
bun a.js
JavaScript/TypeScript code that reproduces the crash?
import a from "./a.wasm";
console.log(a);
Relevant log output
============================================================
Bun v1.1.7 (b0b7db5c) macOS Silicon
Args: "bun", "build", "--target=bun", "a.js"
Elapsed: 24ms | User: 6ms | Sys: 13ms
RSS: 13.12MB | Peak: 13.12MB | Commit: 1.07GB | Faults: 292
panic(main thread): Internal error: missing asset file
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.1.7/Mb1b0b7db5AA2+jpnC23innC+uu/mCm8l3B2+04B+j/9BmwoB+wa__A0eNrzzCtJLcpLzFFILSrKL7JSyM0sLs7MS1dILC5OLVFIy8xJBQDiFgzc
fish: Job 1, 'bun build --target=bun a.js' terminated by signal SIGTRAP (Trace or breakpoint trap)
Exited with code [SIGTRAP]
Stack Trace (bun.report)
Bun v1.1.7 (b0b7db5) on macos aarch64 [BuildCommand]
How can we reproduce the crash?
Crashes:
Outputs the filename, rather than a
WebAssembly.Module
as documentation would suggest:JavaScript/TypeScript code that reproduces the crash?
Relevant log output
Stack Trace (bun.report)
Bun v1.1.7 (
b0b7db5
) on macos aarch64 [BuildCommand]panic: Internal error: missing asset file
debug.panicExtra__anon_315496
debug.panic__anon_289796
src.output.panic__anon_64972
src.bundler.bundle_v2.Chunk.IntermediateOutput.code
src.bundler.bundle_v2.LinkerContext.generateChunksInParallel
src.cli.build_command.BuildCommand.exec
src.cli.Cli.start
main