New issue
Advanced search Search tips

Issue 718370 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Importing modules with/without filetype leads to multiple executions

Reported by johan.is...@gmail.com, May 4 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3088.3 Safari/537.36

Steps to reproduce the problem:
1. Create a ES6 module
2. Import it in one file as import Module from 'Module.js'
3. Import it in another file as import Module from 'Module'

What is the expected behavior?
Should only execute once, or at least give a warning

What went wrong?
Executed twice

Did this work before? N/A 

Chrome version: 60.0.3088.3  Channel: n/a
OS Version: OS X 10.12.4
Flash Version: 

Not sure if it is a bug or by design, but not the way I expect it to work
 

Comment 1 by tkent@chromium.org, May 5 2017

Components: -Blink Blink>HTML>Modules
Labels: TE-NeedsTriageHelp

Comment 3 by neis@chromium.org, May 9 2017

Cc: neis@chromium.org
Could you please provide more information, such as the contents and names of the files involved?

I cannot reproduce the problem you're describing. 'Module.js' is not a valid module specifier, you'd have to use './Module.js'. Similarly, 'Module' is not a valid specifier, you'd have to use './Module', but that is distinct from './Module.js'.
I had ./ but forgot it in steps :)
Test case attached
import.zip
1.0 KB Download
Opening the test case prints executed twice to the console, I would only expect once or at least get a warning that the same module has been included with different file endings

Comment 6 by neis@chromium.org, May 9 2017

Cc: hirosh...@chromium.org kouhei@chromium.org
Thanks. I still can't reproduce it, for me nothing gets executed because neither "./A" nor "./B" exist. I'm on Linux, though, so maybe on Mac OS X the ".js" suffix magically gets appended?!

+hiroshige, +kouhei, who may know more.

Comment 7 by neis@chromium.org, May 9 2017

Is it possible that your web server is configured such that it tries "A.js" when it can't find "A"? That would explain the behavior. As far as Chrome is concerned, "./Twice" and "./Twice.js" are different.
Apparently Apache on my version of OSX has that behaviour per default. I see TCN and Content-Location headers on those without .js. Don’t know why I didn’t think of that my self… sorry to have bothered you. Thanks for your assistance!

On 9 May 2017, 17:43 +0200, n… via monorail <monorail+v2.2428617074@chromium.org>, wrote:

Comment 9 by neis@chromium.org, May 9 2017

Status: WontFix (was: Unconfirmed)

Sign in to add a comment