Uh oh!
There was an error while loading. Please reload this page.
bootstrap: usable error on missing internal module - #29593
Conversation
addaleax
commented
Sep 17, 2019
I’m okay with fast-tracking this if you like. |
nodejs-github-bot
commented
Sep 17, 2019
Fishrock123
commented
Sep 17, 2019
Hmm, guess I forgot to run tests / lint last minute? (I swear I did...)
Not exactly useful here, what's the best way to exclude this rule from this file entirely? |
devsnek
commented
Sep 17, 2019
i'd just |
add9401 to
17df5b6CompareDue to how bootstrap/loaders.js itself is loaded and invoked,
stacktraces from it are munged and no longer point back to the error
source.
That resulted in the following unhelpful error if an internal module
was missing or misnamed:
```
internal/bootstrap/loaders.js:190
return mod.compile();
^
TypeError: Cannot read property 'compile' of undefined
```
This changes that to at least print the id that was attempted to be
loaded:
```
internal/bootstrap/loaders.js:189
if (!mod) throw new TypeError(`Missing internal module '${id}'`);
^
TypeError: Missing internal module 'internal/a'
```17df5b6 to
9f804d1Comparenodejs-github-bot
commented
Sep 17, 2019
nodejs-github-bot
commented
Sep 18, 2019
Trott
commented
Sep 18, 2019
Landed in 4d798e1 |
Due to how bootstrap/loaders.js itself is loaded and invoked,
stacktraces from it are munged and no longer point back to the error
source.
That resulted in the following unhelpful error if an internal module
was missing or misnamed:
```
internal/bootstrap/loaders.js:190
return mod.compile();
^
TypeError: Cannot read property 'compile' of undefined
```
This changes that to at least print the id that was attempted to be
loaded:
```
internal/bootstrap/loaders.js:189
if (!mod) throw new TypeError(`Missing internal module '${id}'`);
^
TypeError: Missing internal module 'internal/a'
```
PR-URL: #29593
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>Fishrock123
commented
Sep 18, 2019
(I actually think TypeError was the wrong choice, but ok, it probably doesn’t matter..) |
joyeecheung
commented
Sep 20, 2019
This only works specifically for the errors caused by incorrect internal module ids (however throwing here right after failure of lookup with the module id in the message still SGTM). #29624 should help printing stack traces for all kinds of errors thrown during bootstrap. |
Due to how bootstrap/loaders.js itself is loaded and invoked,
stacktraces from it are munged and no longer point back to the error
source.
That resulted in the following unhelpful error if an internal module
was missing or misnamed:
```
internal/bootstrap/loaders.js:190
return mod.compile();
^
TypeError: Cannot read property 'compile' of undefined
```
This changes that to at least print the id that was attempted to be
loaded:
```
internal/bootstrap/loaders.js:189
if (!mod) throw new TypeError(`Missing internal module '${id}'`);
^
TypeError: Missing internal module 'internal/a'
```
PR-URL: #29593
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>So that the stack trace of errors shown in internal code run during bootstrap (before process._fatalException is set) can be printed. PR-URL: nodejs#29624 Refs: nodejs#29593 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Due to how bootstrap/loaders.js itself is loaded and invoked,
stacktraces from it are munged and no longer point back to the error
source.
That resulted in the following unhelpful error if an internal module
was missing or misnamed:
```
internal/bootstrap/loaders.js:190
return mod.compile();
^
TypeError: Cannot read property 'compile' of undefined
```
This changes that to at least print the id that was attempted to be
loaded:
```
internal/bootstrap/loaders.js:189
if (!mod) throw new TypeError(`Missing internal module '${id}'`);
^
TypeError: Missing internal module 'internal/a'
```
PR-URL: #29593
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Due to how bootstrap/loaders.js itself is loaded and invoked, stacktraces from it are munged and no longer point back to the error source.
That resulted in the following unhelpful error if an internal module was missing or misnamed:
This changes that to at least print the id that was attempted to be loaded:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes