PANE

Bun Plugins Fail to Filter Protocol Imports

10 posts since Aug 2023, all from GitHub.

“What is the problem this feature would solve? Automatic mocking. I believe it's available in jest: https://jestjs.io/docs/jest object jestcreatemockfrommodulemodulename (and maybe: https://jestjs.io/docs/es6 class mocks automatic mock) The idea is that: A package I would like to…”
GitHub
“What version of Bun is running? 1.0.25 What platform is your computer? Linux 5.15.133.1 microsoft standard WSL2 x86 64 x86 64 What steps can reproduce the bug? Just set the filter of onResolve to catch files without dots: What is the expected behavior? OnResolve should not catch…”
GitHub
“What version of Bun is running? 1.0.1 What platform is your computer? Darwin 21.6.0 x86 64 i386 What steps can reproduce the bug? I'm writing a plugin that uses a custom typescript transformer and outputs js with some extra types metadata. this is a similar scenario to an svelte…”
GitHub

Users are encountering issues with Bun runtime plugins, specifically that the `onResolve` hook doesn't filter imports correctly, leading to unexpected behavior when using custom protocols. This requires manual configuration and adjustments to the plugin's filtering capabilities.

devtoolsbugbunplugintypescript
FIT
0%
SIGNAL
76%
SOURCES10
FRESHEST POSTOCT 2025
TRACKED SINCE31D AGO

SOURCES (10)

“What version of Bun is running? 1.3.0+b0a6feca5 What platform is your computer? Darwin 25.0.0 arm64 arm What steps can reproduce the bug? 1. Set "bun.test.filePattern": " / .test.ts", in .vscode/settings.json. 2. Click the play button to run a Playwright test in web/browser/listing.spec.ts . What is…”

GITHUBOct 2025

“What version of Bun is running? 1.1.17+bb66bba1b What platform is your computer? Darwin 23.5.0 arm64 arm What steps can reproduce the bug? I have created a repo here: https://github.com/joostlubach/bun resolve test. Basically, it contains a plugin.ts as follows: It simply logs any module being resolved. Then it returns undefined to let the default resolver do its work. I have added a bunfig.toml : I have then added two files: test1.ts And other.ts What is the expected behavior? I expect that if”

GITHUBJun 2024

“What is the problem this feature would solve? Automatic mocking. I believe it's available in jest: https://jestjs.io/docs/jest object jestcreatemockfrommodulemodulename (and maybe: https://jestjs.io/docs/es6 class mocks automatic mock) The idea is that: A package I would like to be ignored has too many types, classes, interfaces, objects, etc. And they all have too many child properties etc. To mock it, (especially without requireActual), you have to manually include all the classes/properties b”

GITHUBMay 2024

“What version of Bun is running? 1.1.0+5903a6141 What platform is your computer? Darwin 23.4.0 arm64 arm What steps can reproduce the bug? See my repro repo: https://github.com/TomasHubelbauer/bun runtime plugin onResolve custom protocol Make a runtime plugin with an onResolve hook: Register it in bunfig.toml : preload = ["./plugin.ts"] . Run a script with an import that should get captured by the plugin: bun index.ts : So far everything works as expected: Change the plugin to filter for a custom”

GITHUBApr 2024

“What version of Bun is running? 1.0.25 What platform is your computer? Linux 5.15.133.1 microsoft standard WSL2 x86 64 x86 64 What steps can reproduce the bug? Just set the filter of onResolve to catch files without dots: What is the expected behavior? OnResolve should not catch built in modules, since they can't be further resolved through Bun.resolveSync , and in some situations, we need to proceed with imports without extensions. What do you see instead? The built in modules are caught and ca”

GITHUBFeb 2024

“What version of Bun is running? 1.0.3 What platform is your computer? Darwin 22.1.0 arm64 arm What steps can reproduce the bug? expect.getState() is not implemented. It allows a way to find current describe/test etc What is the expected behavior? expect.getState() is available What do you see instead? expect.getState() type error Additional information No response”

GITHUBOct 2023

“What version of Bun is running? 1.0.1 What platform is your computer? Darwin 21.6.0 x86 64 i386 What steps can reproduce the bug? I'm writing a plugin that uses a custom typescript transformer and outputs js with some extra types metadata. this is a similar scenario to an svelte plugin. The problem is the sourceMaps are broken, esBuild support adding the source map as inlined sourcemaps, example here. But bun is not reading these source maps. here is an example of the loader here is an example o”

GITHUBSep 2023

“What version of Bun is running? 1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a What platform is your computer? Linux 5.15.0 83 generic x86 64 x86 64 What steps can reproduce the bug? 1. Create a file MyModule.ts 2. Export a class MyClass from the module with following structure: 3. Create a file MyModule.test.ts 4. Write a test that tests the myMethod 5. Create another file OtherModule.test.ts 6. Mock / spyOn the myMethod. 7. The myMethod return value test starts failing like this: What is the e”

GITHUBSep 2023

“What version of Bun is running? 1.0.1+31aec4ebe325982fc0ef27498984b0ad9969162b What platform is your computer? Ubuntu 22.04.2 LTS on Windows 10 x86 64 with kernel 5.15.90.1 microsoft standard WSL2 What steps can reproduce the bug? Create a test.ts file with jest and try to mock a library. Snippet: There is also another error that is most likely caused by this one as it is required because of my mocking of some modules. I am modifying env variables to simulate different environments in my tests.”

GITHUBSep 2023

“What version of Bun is running? 0.7.2 What platform is your computer? Darwin 22.5.0 arm64 arm What steps can reproduce the bug? ❌ Test fails with error message ReferenceError: Can't find variable: test : ❌ Test fails with error message ReferenceError: Can't find variable: mock : ✅ Test passes: What is the expected behavior? One or more of the following: 1. All test globals could be made available, even if a test file includes an explicit import from bun:test . In this scenario, this would be a v”

GITHUBAug 2023

SOLUTION LANDSCAPE

Brought to you byTop Sectors

A Player feature.See how many ways this pain can be solved, who's already building, and where the gaps are.

Related panes

/ same corner of the problem