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

Issue 721589 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 721801



Sign in to add a comment

DevTools: [esmodules] inline script module replaces its document

Project Member Reported by paulir...@chromium.org, May 12 2017

Issue description


Demo: https://paulirish.github.io/es-modules-todomvc/

Open sources and view index.html's source.
The file was replaced with the module within it.
See screenshot.



More interesting things happen if an error occurs when importing.
Try 
    import {export404_ButClickThroughOnConsoleLocation} from './helpers.js'

(That's the second screenshot)
 
Screen Shot 2017-05-11 at 5.01.34 PM.png
37.9 KB View Download
Blocking: 721801
Cc: -kozyatinskiy@chromium.org einbinder@chromium.org
Owner: kozyatinskiy@chromium.org
Status: Started (was: Assigned)
https://codereview.chromium.org/2885203006/
Components: Blink>HTML>Script
Project Member

Comment 4 by bugdroid1@chromium.org, May 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99c24962dc687afd137ce69f7efb0a4ae1367301

commit 99c24962dc687afd137ce69f7efb0a4ae1367301
Author: kozyatinskiy <kozyatinskiy@chromium.org>
Date: Fri May 19 08:50:04 2017

[DevTools] inline modules should have correct text offset

.. otherwise we show them incorrectly in DevTools.

BUG= chromium:721589 
R=adamk@chromium.org,dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2885203006
Cr-Commit-Position: refs/heads/master@{#473131}

[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-in-inline-script.html
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/dom/Modulator.h
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/dom/ModulatorImpl.h
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/dom/ModuleScript.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/dom/ModuleScript.h
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/99c24962dc687afd137ce69f7efb0a4ae1367301/third_party/WebKit/Source/core/testing/DummyModulator.h

Status: Fixed (was: Started)

Comment 6 by neis@chromium.org, Jun 1 2017

Labels: -Pri-2 Pri-1
Status: Assigned (was: Fixed)
I believe this is not completely fixed. I'm having the issue shown in the screenshot above. Steps to reproduce:

Serve a file called junk.html:

<html>
<script type="module">
import {x} from "./foo.js";
</script>
</html>

File foo.js is empty, so instantiation fails.

Open junk.html in Chrome (not via file://), open Devtools, click on junk.html in the Sources window and reload. Instead of the above html, the contents shown for junk.html are:

((e) => { throw e; })
Thank you! I'll take a look.
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/65dcbb2ab5805377de065aaa1dbc87215df460f7

commit 65dcbb2ab5805377de065aaa1dbc87215df460f7
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Thu Jun 01 20:32:19 2017

[DevTools] Any module scripts should have correct start position

Modules generate fake script to report an import exception, this fake script should have correct start_position.

Bug:  chromium:721589 
Change-Id: Iac2aa91b9269210d39e834c5467e6ae071cce1e4
Reviewed-on: https://chromium-review.googlesource.com/521143
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476418}
[add] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/LayoutTests/http/tests/inspector/sources/inline-module-export-error-expected.txt
[add] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/LayoutTests/http/tests/inspector/sources/inline-module-export-error.html
[add] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/empty-module.js
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/core/dom/ModuleScript.cpp
[modify] https://crrev.com/65dcbb2ab5805377de065aaa1dbc87215df460f7/third_party/WebKit/Source/core/dom/ModuleScript.h

Status: Fixed (was: Assigned)

Comment 10 Deleted

Ooops, I accidentally removed Georg comment (@neis) and it looks like there is no undelete button in monorail UI.

So, I'll try to reconstruct it here: it was about "Pause on exceptions". With pause on exception enabled in DevTools when we load module with syntax error, we still show incorrect source in DevTools. 
Status: Fixed (was: Assigned)
Root of mentioned issue is how module reports an compiling/parsing exceptions, there is separate issue: https://bugs.chromium.org/p/chromium/issues/detail?id=639739
Project Member

Comment 13 by bugdroid1@chromium.org, Jun 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d9be9fd88d9ee86288c966a4091ef56868e7d5f7

commit d9be9fd88d9ee86288c966a4091ef56868e7d5f7
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Wed Jun 21 16:00:14 2017

Added v8::Module::GetModuleRequestPosition method

This method returns position of importing stmt in module source.

R=neis@chromium.org

Bug:  chromium:721589 
Change-Id: I8639796a001fdfec7cf5aa1bf1a27493f7a757a9
Reviewed-on: https://chromium-review.googlesource.com/541322
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46105}
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/include/v8.h
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/api.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/ast/modules.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/ast/modules.h
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/factory.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/objects-debug.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/objects-inl.h
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/objects-printer.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/objects.h
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/objects/module-info.h
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/objects/scope-info.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/src/parsing/parser.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/test/cctest/test-modules.cc
[modify] https://crrev.com/d9be9fd88d9ee86288c966a4091ef56868e7d5f7/test/cctest/test-parsing.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/62f78ad1631df297cc29264c3efeea7ce5f9e290

commit 62f78ad1631df297cc29264c3efeea7ce5f9e290
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Mon Jun 26 20:08:12 2017

[DevTools] provided initiator.{url,lineNumber} for modules in NetworkPanel

- show referrer url and lineNumber as initiator for modules which are fetched by importing from another modules;

It's not possible to provide valid stack trace here as initiator info since V8 records imports during module parsing and later blink requests this modules during module instantion, at both moments we don't have valid stack trace.

R=allada@chromium.org,kouhei@chromium.org

Bug:  chromium:721589 
Change-Id: Ib9b5c7569c0651cf5a809c88f888a5a21e297edd
Reviewed-on: https://chromium-review.googlesource.com/539565
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482369}
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator-expected.txt
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator.html
[add] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/module1.js
[add] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/module2.js
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/network-initiator-frame.html
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/dom/Modulator.h
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/dom/ModulatorImpl.h
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/dom/ModuleScript.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/inspector/browser_protocol.json
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/core/testing/DummyModulator.h
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/devtools/front_end/network_log/NetworkLog.js
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorInfo.h
[modify] https://crrev.com/62f78ad1631df297cc29264c3efeea7ce5f9e290/third_party/WebKit/Source/platform/wtf/text/TextPosition.h

Sign in to add a comment