New issue
Advanced search Search tips

Issue 899156 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 5
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Dynamic imports broken in DevTools Snippets

Reported by daniel.b...@gmail.com, Oct 26

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Steps to reproduce the problem:
1. Host any ES6 Module (eg: https://example.com/mymodule.js) 
2. Open DevTools on example.com, create a new Snippet:

(async _ => {
  const MyModule = await import('./mymodule.js');
});

3. Run the snippet

What is the expected behavior?
The module should be imported, because the snippet should be executed within the page origin and should therefore have access to that relative module identifier.

This worked fine up until and including Chrome 69.

I couldn't find any notes as to why it would stop working in v70.

Also reproducable in Beta (71.0.3578.20)

What went wrong?
The dynamic import fails:

TypeError: Failed to resolve module specifier './mymodule.js' 
at snippet:///TestSnippet:2:33

Did this work before? Yes 69

Chrome version: 70.0.3538.77  Channel: stable
OS Version: 10.0
Flash Version:
 
Owner: jarhar@chromium.org
Status: Assigned (was: Unconfirmed)
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 5

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

commit 3a0a1f939d610cb07d52bbfb73c209e614296d22
Author: Joey Arhar <jarhar@chromium.org>
Date: Wed Dec 05 01:59:45 2018

[DevTools] Replace compileScript/runScript with evaluate for snippets

Bug:  899156 
Change-Id: Ib0c349c27798b4db3a5612e83b882e101c9f478c
Reviewed-on: https://chromium-review.googlesource.com/c/1318795
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613811}
[modify] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/renderer/devtools/front_end/console/ConsoleViewMessage.js
[modify] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/renderer/devtools/front_end/object_ui/ObjectPropertiesSection.js
[modify] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/renderer/devtools/front_end/snippets/ScriptSnippetFileSystem.js
[modify] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-snippet-model-expected.txt
[modify] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-snippet-model.js
[add] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/web_tests/http/tests/devtools/sources/resources/module.js
[add] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/web_tests/http/tests/devtools/sources/snippet-module-expected.txt
[add] https://crrev.com/3a0a1f939d610cb07d52bbfb73c209e614296d22/third_party/blink/web_tests/http/tests/devtools/sources/snippet-module.js

Status: Fixed (was: Assigned)

Sign in to add a comment