module-resolve-invalid: Invalid module resolution result
Cause
resolveHook returned a value other than a non-empty string.
Troubleshooting
- Locate the specifier being resolved and its referrer in the error message.
- Check every return path in the hook for
undefined,null, objects, or empty strings. - Check whether the hook was declared
async.resolveHookis synchronous and cannot return a promise.
Solution
Make resolveHook(specifier, referrer) synchronously return a non-empty canonical specifier. URL-like imports can use new URL(specifier, referrer).href. For virtual application modules, return a stable canonical key and provide its content through modules or importHook.
