GeezerVison is showing github.com — errors: fix ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK · nodejs/node@1e5afb7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/errors.md +8Lines changed: 8 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1340,6 +1340,14 @@ strict compliance with the API specification (which in some cases may accept |
1340 | 1340 | `func(undefined)` and `func()` are treated identically, and the |
1341 | 1341 | [`ERR_INVALID_ARG_TYPE`][] error code may be used instead. |
1342 | 1342 |
|
| 1343 | +<a id="ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK"></a> |
| 1344 | +### ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK |
| 1345 | + |
| 1346 | +> Stability: 1 - Experimental |
| 1347 | +
|
| 1348 | +An [ES6 module][] loader hook specified `format: 'dynamic'` but did not provide |
| 1349 | +a `dynamicInstantiate` hook. |
| 1350 | + |
1343 | 1351 | <a id="ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST"></a> |
1344 | 1352 | ### ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST |
1345 | 1353 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/errors.js +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -747,6 +747,9 @@ E('ERR_MISSING_ARGS', |
747 | 747 | } |
748 | 748 | return `${msg} must be specified`; |
749 | 749 | }, TypeError); |
| 750 | +E('ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK', |
| 751 | + 'The ES Module loader may not return a format of \'dynamic\' when no ' + |
| 752 | + 'dynamicInstantiate function was provided', Error); |
750 | 753 | E('ERR_MISSING_MODULE', 'Cannot find module %s', Error); |
751 | 754 | E('ERR_MODULE_RESOLUTION_LEGACY', |
752 | 755 | '%s not found by import in %s.' + |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/loader.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
5 | 5 | ERR_INVALID_RETURN_PROPERTY, |
6 | 6 | ERR_INVALID_RETURN_PROPERTY_VALUE, |
7 | 7 | ERR_INVALID_RETURN_VALUE, |
8 | | - ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK, |
| 8 | + ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK, |
9 | 9 | ERR_UNKNOWN_MODULE_FORMAT |
10 | 10 | } = require('internal/errors').codes; |
11 | 11 | const { URL } = require('url'); |
@@ -118,7 +118,7 @@ class Loader { |
118 | 118 | let loaderInstance; |
119 | 119 | if (format === 'dynamic') { |
120 | 120 | if (typeof this._dynamicInstantiate !== 'function') |
121 | | - throw new ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK(); |
| 121 | + throw new ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK(); |
122 | 122 |
|
123 | 123 | loaderInstance = async (url) => { |
124 | 124 | debug(`Translating dynamic ${url}`); |
|