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

Regression: release 1.1.45 broke ?url imports #16476

Open
tmr232 opened this issue Jan 17, 2025 · 0 comments · May be fixed by #16480
Open

Regression: release 1.1.45 broke ?url imports #16476

tmr232 opened this issue Jan 17, 2025 · 0 comments · May be fixed by #16480
Labels
bug Something isn't working regression

Comments

@tmr232
Copy link

tmr232 commented Jan 17, 2025

What version of Bun is running?

1.1.45

What platform is your computer?

Ubuntu 22.04.5 LTS

What steps can reproduce the bug?

git clone https://github.com/tmr232/function-graph-overview/
cd function-graph-overview
bun install
bun test

What is the expected behavior?

I expect all the tests to run successfully, as they do up to and including bun-v1.1.44:

(this is the end of the output. The rest removed for brevity.)

 428 pass
 0 fail
 238 snapshots, 257 expect() calls
Ran 428 tests across 4 files. [2.24s]

What do you see instead?

The tests fail with the following error:

bun test v1.1.45 (196621f2)

src\test\backlinks.test.ts:
✓ detect-backlinks-0
✓ detect-backlinks-1
✓ detect-backlinks-2
✓ detect-backlinks-3

src\test\commentTest.test.ts:

# Unhandled error between tests
-------------------------------
2949 |               bytes = Promise.resolve(input);
2950 |             } else {
2951 |               const url = input;
2952 |               if (typeof process !== "undefined" && process.versions && process.versions.node) {
2953 |                 const fs = require("fs");
2954 |                 bytes = Promise.resolve(fs.readFileSync(url));
                                                  ^
ENOENT: no such file or directory, open 'C:\Code\sandbox\function-graph-overview\parsers\tree-sitter-c.wasm?url'
    path: "C:\\Code\\sandbox\\function-graph-overview\\parsers\\tree-sitter-c.wasm?url",
 syscall: "open",
   errno: -2,
    code: "ENOENT"

      at load (C:\Code\sandbox\function-graph-overview\node_modules\web-tree-sitter\tree-sitter.js:2954:44)
      at <anonymous> (C:\Code\sandbox\function-graph-overview\src\parser-loader\bun.ts:10:48)
-------------------------------


src\test\ranges_class.test.ts:
✓ Basic Range Test
✓ Add to 0
✓ Add to same start
✓ Invalid range addition

src\test\zip.test.ts:
✓ zip
✓ structZip
✓ pairwise

 11 pass
 1 fail
 1 error
 19 expect() calls
Ran 12 tests across 4 files. [153.00ms]

The relevant import is defined in https://github.com/tmr232/function-graph-overview/blob/main/src/parser-loader/wasmMapping.ts

Additional information

The ?url queries are added because the same file is currently used both when running directly in Bun, and also when building a website using Vite.

If I remove the ?url query, Bun-v1.1.45 works but Vite does not, so it's not a good solution in my case.

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

Successfully merging a pull request may close this issue.

2 participants