You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Set a default framework to use# By default, bun will look for an npm package like `bun-framework-${framework}`, followed by `${framework}`macros.react-relay.graphql = "bun-macro-relay"macros.relay-runtime.graphql = "bun-macro-relay"
[define]
# Replace any usage of "process.env.bagel" with the string `lox`.# The values are parsed as JSON, except single-quoted strings are supported and `'undefined'` becomes `undefined` in JS.# This will probably change in a future release to be just regular TOML instead. It is a holdover from the CLI argument parsing."process.env.bagel" = "'lox'""process.env.donut" = "[1, 2]""process.env.pie" = "null""process.env.pie2" = 'noob'"process.env.pie3" = '"noob"'"process.env.pie4" = '`${noob}`'"process.env.pie5" = '{"a":1,"b":2,"c":3}'
Now run:
FORCE_COLOR=1 QUIET= QUIET2= bun dev
Or (Linux x64):
FORCE_COLOR=1 QUIET= QUIET2= /build/bun/packages/debug-bun-linux-x64/bun-debug dev
After opening localhost:3000 and refreshing the page 4 to 10 times, we get a Segfault. I did not narrow the files down more because there are some other weird interactions going on.
When tsconfig.json is configured like so, we get another weird behavior:
{
"compilerOptions": {
"lib": ["ESNext"],
"module": "esnext",
"target": "esnext",
"moduleResolution": "node",
// so that if your project isn't using TypeScript, it still has autocomplete"allowJs": true,
// "bun-types" is the important part"types": ["bun-types"]
}
}
The line process.env.pie5.b; is supposed to compile to ({ a: 1, b: 2, c: 3 }).b;, and correctly compiles the first time localhost:3000/ is opened. However, after refreshing the page 4 to 10 times it compiles to ({ "": 1, "": 2, string: 3 }).b;. (With slightly different environment variables I was about to get one of those keys to be object instead)
Unfortunately stack trace does not work on Linux so here's my handwritten trace for the Segfault:
Version
0.1.13
Platform
What steps will reproduce the bug?
This only happens on some runs, so one has to run
bun dev
and spam F5 to get the segfault.src/index.js:
Make a
bunfig.toml
file:Now run:
Or (Linux x64):
After opening localhost:3000 and refreshing the page 4 to 10 times, we get a Segfault. I did not narrow the files down more because there are some other weird interactions going on.
When
tsconfig.json
is configured like so, we get another weird behavior:The line
process.env.pie5.b;
is supposed to compile to({ a: 1, b: 2, c: 3 }).b;
, and correctly compiles the first time localhost:3000/ is opened. However, after refreshing the page 4 to 10 times it compiles to({ "": 1, "": 2, string: 3 }).b;
. (With slightly different environment variables I was about to get one of those keys to beobject
instead)Unfortunately stack trace does not work on Linux so here's my handwritten trace for the Segfault:
Here's the call stack from VSCode:
Additional information
Perhaps there is some hashing issue going on?
The text was updated successfully, but these errors were encountered: