-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
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
Uncaught error with --experimental-import-meta-resolve
#55518
Comments
The assertion is failing because it expects the URL's protocol to be |
I would like to work on this. In the function if (resolved.protocol !== 'file:') {
throw new ERR_INVALID_URL_SCHEME(resolved.protocol);
} |
No, That wouldn't work. Under the hood, the issue is because it's trying to read the package configuration for the URL, which it can't do. There are cases where a URL can be used, this is not one of them. |
According to this, can we then check for the URL protocol in |
I believe @JakobJingleheimer may know more than I (regarding the package.json reading) (if not, sorry for the ping) |
The provided code sample looks like a loader hook. If so, |
The code sample just demonstrates the different behavior for resolving a bare specifier in |
Regardless, it shouldn't crash at the CPP level. It should probably through a module not found error? |
PR-URL: nodejs#55777 Fixes: nodejs#55518 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#55777 Fixes: nodejs#55518 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Version
22.10
Platform
Subsystem
No response
What steps will reproduce the bug?
Run with
--experimental-import-meta-resolve
:How often does it reproduce? Is there a required condition?
Always reproduces
What is the expected behavior? Why is that the expected behavior?
A catchable error that the specifier can't be resolved. This allows to provide a helpful error message that the user should add a custom resolver/loader.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: