Runtime plugin onResolve
behaves incorrectly for asynchronous imports
#9862
Labels
bug
Something isn't working
onResolve
behaves incorrectly for asynchronous imports
#9862
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 the reproduction repository: https://github.com/TomasHubelbauer/bun-runtime-plugin-onResolve-sync-async-import
Make a plugin that uses
onResolve
to map non-existent paths to existent paths:Register it in
bunfig.toml
:Come up with a script that has sync and async imports matching the plugin's
onResolve
filter
:Run the script:
bun index.ts
:What is the expected behavior?
The async import should resolve to
./async.ts
(which it seems to be doing) and then the built-in loader for*.ts
should pick it up as it does with the sync import. The output should be this:What do you see instead?
Additional information
This seems to be specifically related to async imports.
The text was updated successfully, but these errors were encountered: