Feature Request: show relative path to module in UnresolvableExport error
Reported by
g...@gopositron.com,
Oct 28 2017
|
||||||
Issue descriptionwhile migrating a large project to ESM from require it can be very confusing to see `The requested module does not provide an export named 'default'` but not know which module that is in hundreds of files. solution: `The requested module "relative path here" does not provide an export named 'whatever'`
,
Nov 2 2017
,
Nov 2 2017
,
Nov 2 2017
,
Nov 2 2017
I think there are two orthogonal problems. 1) On the V8 side, we throwing the exception we record the precise source location of the offending statement in the isolate's "message" object. Blink should report this location but somehow doesn't. In my local test, Devtools console incorrectly associates the exception with the opening <html> tag in the main document. 2) When a _dynamic_ import fails, then even if the above issue is fixed, we will lose the source location. This is because the isolate's message object is not part of the exception object, and only the latter makes it to the promise handler. The exception object does contain some kind of stack trace but that is not the stack we are interested in (in my test it is always empty, containing only the error string itself).
,
Nov 3 2017
To the reporter: As a temporary workaround, you can run chrome with --js-flags=--print-all-exceptions. This should tell you the location of the importing statement where the exception originates: Exception thrown: at http://localhost:8888/junk1.js, line 6 0xe2e6319ebb9: [JS_ERROR_TYPE] [...]
,
Nov 29 2017
This is a major hurdle to using modules in development. I tried to use the workaround of --js-flags=--print-all-exceptions but it prints way to much to be useful.
,
Dec 7 2017
Regarding (1), could someone have a look at the blink side to see what the problem there is? Regarding (2), I'm preparing a CL that includes the module specifier in the error message. This will of course also make (1) less serious.
,
Dec 7 2017
,
Dec 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/d8a5506ce8dd0f866a44e2bb5d685728b993420d commit d8a5506ce8dd0f866a44e2bb5d685728b993420d Author: Georg Neis <neis@chromium.org> Date: Fri Dec 08 09:11:58 2017 [modules] Include module specifier in instantiation error messages. Bug: chromium:780819 Change-Id: I07c5ff3cf955edb087a175ea2d71a35e0f520ec3 Reviewed-on: https://chromium-review.googlesource.com/813839 Commit-Queue: Georg Neis <neis@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/master@{#49953} [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/src/messages.h [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/src/objects/module.cc [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/src/objects/module.h [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-cycle1.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-cycle2.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-cycle3.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-cycle4.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-cycle5.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-cycle6.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-import1.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-import2.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-import3.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-import4.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-import5.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-import6.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-star-conflict1.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-star-conflict2.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/message/fail/modules-star-default.out [modify] https://crrev.com/d8a5506ce8dd0f866a44e2bb5d685728b993420d/test/mjsunit/harmony/modules-import-15.js
,
Feb 9 2018
Closing this now as the reporter's request has been implemented. I've filed a separate issue for (1): https://bugs.chromium.org/p/chromium/issues/detail?id=810728
,
Feb 9 2018
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by gsat...@chromium.org
, Oct 28 2017Cc: gsat...@chromium.org
Components: Language
Labels: Priority-2
Owner: neis@chromium.org
Status: Assigned (was: Untriaged)