Closed stephenh closed 2 months ago
Probably a .env loader crash. Really need to fix that. Are there Windows newlines or trailing spaces in the .env file?
@Jarred-Sumner I don't think it's the env loader, b/c if I run a different test, it goes further:
$ bun test src/entities/Book.test.ts
bun test v0.6.7 (59d7c47e)
[0.02ms] ".env"
src/entities/Book.test.ts:
✓ Book > non-null reference might still have a null id [2.28ms]
✓ Book > should have default values populated immediately on create if they aren't provided as opts [0.44ms]
[bun] Warning: async_hooks has not been implemented yet. See https://github.com/oven-sh/bun/issues/1832
✓ Book > can update without the order field causing syntax errors [29.06ms]
It hangs there, which is the 1st time it would make a db call (the first two tests in Book.test.ts
don't actually make db tests).
Per the async_hooks
warning, I've technically imported the module, but commented out the code we use that actually relies on it (reads from it). ...well...shoot, maybe not all the code. Let me try making sure that is all gone; apologies if that ends up being it, as I knew that was not supported yet.
Memory issues are very mysterious sometimes. If you delete the .env file and manually set the env vars, does it still segfault?
Sure, I've removed the .env
file, set the only variable (DATABASE_URL
) manually in fish, and the same seg fault still happens.
I also fully removed the AsyncLocalStorage
import/code, and same behavior: Author.test.ts
seg faults, and Book.test.ts
hangs, although looks like it only hangs after doing all of the expected db calls, according to the knex output, which is good! (I'd assumed it was hanging on its initial db call.)
Alright, probably a bug in Bun.connect (which internally is used by node:net). @cirospaciari can you take a look when you get a chance?
Alright, probably a bug in Bun.connect (which internally is used by node:net). @cirospaciari can you take a look when you get a chance?
Sure! Will take a look on this
I got the same error using pino-pretty
, so I just removed it from the project, and the error has gone.
Looks like this is not happening any more in the current canary if is happening after bun upgrade --canary
feel free to reopen
What version of Bun is running?
0.6.7
What platform is your computer?
Linux 5.19.0-42-generic x86_64 x86_64
What steps can reproduce the bug?
git checkout bun
yarn
+yarn build
to compile the cross-project workspace dependenciesmake db
to start the postgres db in dockercd packages/integration-tests
bun test src/entities/Author.test.ts
What is the expected behavior?
The test runs.
What do you see instead?
A seg fault:
Additional information
Joist is a admittedly a niche ORM, but it uses pretty vanilla knex / node-pg to make db queries, so when I saw Prisma works in 0.6.7, I thought I'd try it out with Joist.