Skip to content

Commit 24afb0b

Browse files
committed
Apply suggestions from code review
1 parent 6aa3de7 commit 24afb0b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/api/errors.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2964,12 +2964,21 @@ import 'package-name'; // supported
29642964
### `ERR_UNSUPPORTED_RESOLVE_REQUEST`
29652965

29662966
An attempt was made to resolve an invalid module referrer. This can happen when
2967-
calling `import()` or `import.meta.resolve()` with either:
2967+
importing or calling `import.meta.resolve()` with either:
29682968

29692969
* a bare specifier that is not a builtin module from a module whose URL scheme
29702970
is not `file`.
29712971
* a [relative URL][] from a module whose URL scheme is not a [special scheme][].
29722972

2973+
```js
2974+
try {
2975+
// Trying to import the package 'bare-specifier' from a `data:` URL module:
2976+
await import("data:text/javascript,import%22bare-specifier%22");
2977+
} catch(e) {
2978+
console.log(e.code); // ERR_UNSUPPORTED_RESOLVE_REQUEST
2979+
}
2980+
```
2981+
29732982
<a id="ERR_USE_AFTER_CLOSE"></a>
29742983

29752984
### `ERR_USE_AFTER_CLOSE`

0 commit comments

Comments
 (0)