ERR_UNSUPPORTED_RESOLVE_REQUEST


尝试解析无效的模块引用时出现问题。这可能发生在导入或调用 import.meta.resolve() 时出现以下情况:

【An attempt was made to resolve an invalid module referrer. This can happen when importing or calling import.meta.resolve() with either:】

  • 一个来自其 URL 方案不是 file 的模块的、非内置模块的裸指定符。
  • 一个来自其 URL 方案不是 特别方案 的模块的 相对网址
try {
  // Trying to import the package 'bare-specifier' from a `data:` URL module:
  await import('data:text/javascript,import "bare-specifier"');
} catch (e) {
  console.log(e.code); // ERR_UNSUPPORTED_RESOLVE_REQUEST
}