Skip to content

fix: use __glob_dynamic for dynamic import#4153

Open
suguanYang wants to merge 1 commit intoevanw:mainfrom
suguanYang:bugfix/dynamic-import-glob
Open

fix: use __glob_dynamic for dynamic import#4153
suguanYang wants to merge 1 commit intoevanw:mainfrom
suguanYang:bugfix/dynamic-import-glob

Conversation

@suguanYang
Copy link
Copy Markdown

@suguanYang suguanYang commented Apr 22, 2025

This fix #3980 by provides a different glob function: __glob_dynamic which returns a rejected promise for module not found error

Reference:
https://tc39.es/ecma262/#sec-import-calls

The host environment must perform FinishLoadingImportedModule(referrer, moduleRequest, payload, result), where result is either a normal completion containing the loaded Module Record or a throw completion, either synchronously or asynchronously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESM dynamic import to glob imports, throw synchronous error

1 participant