New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 757105 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

ES6 module loader silently halts on invalid paths

Project Member Reported by sdh@google.com, Aug 18 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.66 Safari/537.36

Steps to reproduce the problem:
1. Enable ES6 module support in experimental flags
2. Serve an HTML file with the following:
   <script type="module">import 'foo'; console.log('done!');</script>
3. Load the page

What is the expected behavior?
The console should say *something* - either "done!" or an error.  (Note: if 'foo' is changed to '/foo', then the console shows a 404 trying to load the import)

What went wrong?
The console is completely silent.  The network panel is empty since the loader doesn't know how to resolve 'foo', so it doesn't even try.  But as a result, there's no 404 error.  The module just stops evaluating at the invalid import, but doesn't report that anything went wrong.

Did this work before? N/A 

Chrome version: 60.0.3112.66  Channel: n/a
OS Version: 
Flash Version: 

This is a significant problem, since there's a lot of otherwise-browser-compatible code out there that uses babel to rewrite CommonJS-style imports.  If attempting to load such a file in the browser directly, this is exactly what will happen, and so we need a clearer message pointing developers to what went wrong.
 

Comment 1 by l...@chromium.org, Aug 20 2017

Cc: l...@chromium.org
Owner: kozyatinskiy@chromium.org
Thanks for the report.  I've made a jsfiddle to repro:
https://jsfiddle.net/b7ekpd4q/

The spec on Runtime semantics does say 'If a Module Record corresponding to the pair referencingModule, specifier does not exist or cannot be created, an exception must be thrown.'  When I try this in Chrome 59, there's no error, but when I try this in Canary  62.0.3190.0, I do see a TypeError "Failed to resolve module specifier 'foo'"

Could you please check to see if this works on Canary for you?

Comment 2 by ajha@chromium.org, Aug 24 2017

Cc: ajha@chromium.org
Labels: Needs-Triage-M60 M-60 Needs-Feedback OS-Mac OS-Windows
Similar TypeError "Failed to resolve module specifier 'foo'" is also seen on the latest Beta(61.0.3163.59) on Mac OS 10.12.6 as well.

Issue is specific to M-60 where there is nothing shown in the console.

sdh@: Could you please check this on the latest Beta or canary and confirm as per the repro jsfiddle.

Thank you!


Comment 3 by ajha@chromium.org, Aug 24 2017

Status: Assigned (was: Unconfirmed)

Comment 4 by l...@chromium.org, Oct 10 2017

Status: Archived (was: Assigned)

Sign in to add a comment