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

compile: missing asset file (hard to debug) #3903

Closed
CodeFromAnywhere opened this issue Jul 31, 2023 · 6 comments · Fixed by #8178
Closed

compile: missing asset file (hard to debug) #3903

CodeFromAnywhere opened this issue Jul 31, 2023 · 6 comments · Fixed by #8178
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@CodeFromAnywhere
Copy link

What version of Bun is running?

0.7.1

What platform is your computer?

Darwin 21.6.0 arm64 arm

What steps can reproduce the bug?

compile a big codebase, for some reason, it gives "missing asset file" for me.

What is the expected behavior?

I get a stack trace or something that would tell me what exactly is missing and where

What do you see instead?

Just "missing asset file" is not good enough for me to solve the problem

Additional information

bun-server bun run build
$ bun build ./src/server.ts --compile --outfile server

uh-oh: Internal error: missing asset file
bun will crash now 😭😭😭

----- bun meta -----
Bun v0.7.1 (53cc4df1) macOS Silicon 21.6.0
BuildCommand: 
Elapsed: 137ms | User: 287ms | Sys: 95ms
RSS: 0.34GB | Peak: 0.34GB | Commit: 0.41GB | Faults: 0
----- bun meta -----

0   0x102042b4c WTFGetBacktrace
1   ??? Bun__crashReportDumpStackTrace

Crash report saved to:
 ~/.bun/.bun-crash/v0.7.1-1690787568648.crash

Search GitHub issues https://bun.sh/issues or ask for #help in https://bun.sh/discord

thread 1236859 panic: Internal error: missing asset file
error: script "build" exited with code 6 (SIGABRT)
@CodeFromAnywhere CodeFromAnywhere added the bug Something isn't working label Jul 31, 2023
@Jarred-Sumner
Copy link
Collaborator

Are any of the packages using .node files? It's likely caused by that

@Jarred-Sumner
Copy link
Collaborator

(but yes the error is terrible and needs to be made clearer)

@CodeFromAnywhere
Copy link
Author

CodeFromAnywhere commented Jul 31, 2023

Yes there are multiple packages I use that have .node files, such as @swc/core, uiohook-napi and tiktoken-node. I certainly need @swc/core (https://swc.rs) so wondering if this will become possible

Edit: removed unused packages uiohook-napi and tiktoken-node... Still getting the same. Maybe the .node file in @swc/core

@Jarred-Sumner
Copy link
Collaborator

yeah unfortunately bun build --compile and bun build lacks . node file support right now. bun build is entirely optional though, you can use bun without the build step

@robobun robobun added build An issue related to building or compiling bundler Something to do with the bundler and removed build An issue related to building or compiling labels Jul 31, 2023
@CM-IV
Copy link

CM-IV commented Aug 24, 2023

I'm having the same issue using a library made with the age Rust crate via napi-rs.

@Electroid
Copy link
Contributor

Related: #6567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants