ES6 module double execution
Reported by
nicholas...@gmail.com,
Sep 23
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Steps to reproduce the problem: 1. Load the specific script e.g. <script src="https://unpkg.com/@polymer/paper-input@next/paper-input.js?module" type="module" asnmc></script> which tries to define a custom element 2. Look at the console error 3. Notice that dom-module.js is execute twice (once normally, once as VMxxxx dom-module.js) MWE at https://jsbin.com/taqomoz/edit?html,output What is the expected behavior? Single execution of each module (once per url). What went wrong? https://unpkg.com/@polymer/polymer@3.0.5/lib/elements/dom-module.js?module gets executed twice, thus double-defining the "dom-module" custom element. Did this work before? N/A Chrome version: 69.0.3497.100 Channel: stable OS Version: 10.0 Flash Version: Notice that always the second script gets VM'd (why?). I found this https://stackoverflow.com/questions/17367560/chrome-development-tool-vm-file-from-javascript) but I don't see how this applies here as no modification is applied. The script gets a 302 and then a 200 response from unpkg.com. Maybe that has something to do with the VM-ification? Strangely Firefox also double executes this script.
,
Sep 23
,
Sep 24
,
Sep 27
I think this is working as intended and it's a problem with the CDN packaging script. There are two dom-module modules being loaded: https://unpkg.com/@polymer/polymer@^3.0.0/lib/elements/dom-module.js?module https://unpkg.com/@polymer/polymer@3.0.5/lib/elements/dom-module.js?module The first one is from an old paper-input; the second one is from Polymer 3.0.5 element mix-in, etc. It would be nice if DevTools could put some breadcrumbs of the module require graph in the callstack for module execution. That would make it really easy to see what's happening here. |
||||
►
Sign in to add a comment |
||||
Comment 1 by nicholas...@gmail.com
, Sep 23