Comments (14)
@jackyzha0 looks like there's a bug where the outfile is becoming the basename instead of the directory, so --outfile=dist/foo
becomes foo
from bun.
working as intended. --compile
sets --target=bun
and some other flags, as it is not possible to use --compile without them set.
from bun.
Why is this working as intended? The --compile
flag should raise an error if it fails to build the binary
from bun.
Is it failing to build the binary? --compile
supports .node
files
from bun.
Why is this working as intended?
The error is due to the default value of --format
(browser), see
To load node files, set target to "bun"
With --compile
, this is flipped to --target=bun
It seems this is not clear and documentation and error messages should be revised.
from bun.
Yes, it fails to emit the binary. This still happens with --target=bun
, let me see if I can put together a minimal repro for yall
from bun.
Ah it actually does seem to compile properly but it doesn't seem to respect --outfile
from bun.
https://github.com/jackyzha0/bun-compile-repro
from bun.
thank you for the reproduction. this specifically only happens when a node file is included
from bun.
hey, any pointers on where I can look to maybe submit a PR for this?
from bun.
build_command.zig line 297, in that code block i suspect this might be.
may be worth checking if this happens without --compile. seems likely since the absolute outfile is already decided it might not actually be, not 100% sure.
StandaloneModuleGraph.zig line 525 might be the wrong directory
from bun.
Confirmed that this bug was not present in v1.0.23 or v1.0.24 (but only on Mac OS??) bug seems to affect only Linux from my tests so far. Let me backdate a few versions to confirm
from bun.
var output_dir = this_bundler.options.output_dir;
if (outfile.len > 0 and output_files.len == 1 and output_files[0].value == .buffer) {
output_dir = std.fs.path.dirname(outfile) orelse ".";
output_files[0].dest_path = std.fs.path.basename(outfile);
}
I suspect it might be here (L299 in bun/src/cli/build_command.zig
)? For including .node
files, output_files.len > 1
so this path to properly set output_dir
never gets hit?
hm nvm that doesn't seem to be it
from bun.
spent a few hours looking at it but couldn't figure it out :( would appreciate if yall could help take a look when you get the chance!
from bun.
Related Issues (20)
- may bun will auto stop my sync work?
- [win][fs] Some functions do not support tailing dot `"."` and space `" "` in a filename HOT 4
- ccxt freezing
- Module._resolveLookupPaths is not a function | dd-trace
- bun test --test-name-pattern is broken
- Bun.readableStreamToArrayBuffer() doesn't resolve to an ArrayBuffer when Bun.stdin.stream() is passed HOT 3
- spawnSync() does not honor "inherit" after position 2 in stdio HOT 2
- Type error when using arrays in bun shell HOT 3
- spawn: ssh-keyscan: fdlim_get: bad value
- `readline` module yields wrong and incomplete values with a bad performance (compared to NodeJS) HOT 2
- [win] Debugging/running on VSCode on Windows doesn't work HOT 2
- `ServerResponse.setHeader` does not set header during `bun test`
- JS Setter is written as `Getter` in console.log HOT 1
- bun install not working on github action HOT 2
- discord.js bot memory usage 6x higher and climbing with switch from Node to Bun HOT 5
- Bun Shell $: line by line stderr output HOT 4
- Encountered Watchpack Error (watcher): Error: AccessDenied error on Ubuntu 22.04.3
- bun: symbol lookup error (undefined symbol: node_module_register) HOT 1
- `bun install` exits with `0` when not all packages could be installed HOT 2
- Fetching from Sveltekit SSR drops all headers while running Vite dev server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.