Skip to content

Conversation

@suguanYang
Copy link

@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.

@suguanYang
Copy link
Author

Actually the current synchronous behavior is similar to nodejs, should we respect the specification or the host platform?

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