We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.1.42+50eec0025
Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 unknown
Create a src/index.ts file:
console.log("Starting app..."); new Worker(new URL("./workers/worker.ts", import.meta.url).href);
Create a src/workers/worker.ts file:
console.log("Hello from the worker!");
Run the following commands: Development Mode:
bun run ./src/index.ts --watch
Build Mode:
bun build --sourcemap --minify --compile --outfile ./dist/output --target bun ./src/index.ts ./src/workers/worker.ts ./dist/output
new Worker("./workers/emailWorker.ts"); new Worker(new URL("./workers/emailWorker.ts", import.meta.url)); new Worker(new URL("./workers/emailWorker.ts", import.meta.url).href);
The worker file should resolve correctly and execute without errors in both modes.
Development Mode: Running bun run ./src/index.ts --watch produces the following:
Hello from the worker!
Running
gives the following:
1 | new Worker(new URL("./workers/worker.ts", import.meta.url).href); ^ TypeError: BuildMessage: ModuleNotFound resolving "/$bunfs/root/workers/worker.ts" (entry point) at src/index.ts:1:1 Bun v1.1.42 (Linux x64)
Would love clarification on whether this is a bug or intended behavior. Thank you!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Bun is running?
1.1.42+50eec0025
What platform is your computer?
Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 unknown
What steps can reproduce the bug?
Here’s a minimal reproduction of the issue:
Create a src/index.ts file:
Create a src/workers/worker.ts file:
Run the following commands:
Development Mode:
Build Mode:
What is the expected behavior?
According to the Bun documentation, any of the following should work for worker paths, consistently across both dev and build modes:
The worker file should resolve correctly and execute without errors in both modes.
What do you see instead?
Development Mode:
Running
bun run ./src/index.ts --watch
produces the following:Running
gives the following:
Additional information
Would love clarification on whether this is a bug or intended behavior. Thank you!
The text was updated successfully, but these errors were encountered: