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

Issue 685552 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit 29 days ago
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug

Blocked on:
issue 670180



Sign in to add a comment

Sourcemaps work only for window that first loaded bundled file

Reported by milansta...@gmail.com, Jan 26 2017

Issue description

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

Steps to reproduce the problem:
1. Make file with one IIFE or anything else
2. Bundle file using gulp sourcemaps plugin
3. Make frameTest.html that only includes bundled file
4. Make index.html that includes bundled file and has iframe with src for frameTest.html
5. Set breakpoint

What is the expected behavior?
Debbuger shows and stops in sourcemap file for every loaded instance of bundled file

What went wrong?
Debbuger shows and stops in sourcemap file only for first loaded instance of bundled file, for the others it shows bundled file. 

Did this work before? N/A 

Chrome version: 55.0.2883.87  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 24.0 r0

Link to the testing repo: https://github.com/milanstamenkovic/gulp_sourcemaps_test
 
Components: -Platform>DevTools Platform>DevTools>JavaScript
Status: Untriaged (was: Unconfirmed)
You can run it from here -
https://rawgit.com/milanstamenkovic/gulp_sourcemaps_test/master/index.html

- Pause on caught errors
- "Source map detected" appears, but it breaks in the bundle file anyway.
The exact behavior is inconsistent (the console log sometimes shows the bundle and sometimes shows the original script - test.js), but it always shows the bundle in Sources when it breaks (which is the most problematic behavior).
Corrections - 
*Pause on caught errors = Enable "Pause on caught exceptions"
*the console log = the stack shown in the console
Owner: lushnikov@chromium.org

Comment 6 by de...@codex9.com, Feb 2 2017

I've been struggling to get to the bottom of this issue for days now. I was initially convinced it's to do with the paths in my sourcemap file because breakpoints always seemed to hit in the source when in the parent window, but once a child iframe is added that also loads that file then breakpoints only hit in the bundle from that point on.

Comment 7 by de...@codex9.com, Feb 3 2017

This is the repo I'm using to test (based on the milanstamenkovic one) as my iframe content are a level down and I wanted to see if that made a difference.
I'm seeing the same, is there a workaround?

Comment 10 by de...@codex9.com, Feb 22 2017

Any update or this? Is there a workaround?
Labels: -Pri-2 Pri-1
Status: Assigned (was: Untriaged)
Bumping priority of this; i'll take a look.
Blockedon: 670180
For the record: it turned out that the reason is CompilerScriptMapping which doesn't populate sourceMap sources UISourceCodes per every frame.

This will be fixed as we move to the "one UISourceCode per url" world.
Project Member

Comment 13 by bugdroid1@chromium.org, Mar 8 2017

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

commit 95ff5bc751ba619a7c37155eec85c1adcadb01bc
Author: lushnikov <lushnikov@chromium.org>
Date: Wed Mar 08 21:40:02 2017

DevTools: add tests to fixate sourcemap bindings behavior

These tests fixate how source map bindings, such as
CompilerScriptMapping and SASSSourceMapping, produce sources
correctly for frames.

As these tests reveal, CompilerScriptMapping currently doesn't
attach sources for all frames.

BUG=670180, 685552 
R=dgozman

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

[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated-expected.txt
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-main-frame-navigated.html
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-main-frame-navigated-expected.txt
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/navigator-main-frame-navigated.html
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-frame.html
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-sass.scss
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-script.js
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-script.js.map
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-style.css
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-style.css.map
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/resources/sourcemap-typescript.ts
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames.html
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames-expected.txt
[add] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames.html
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/95ff5bc751ba619a7c37155eec85c1adcadb01bc/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js

Project Member

Comment 14 by bugdroid1@chromium.org, Apr 1 2017

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

commit 625244e25254fb6479b3122d92145c596616a196
Author: lushnikov <lushnikov@chromium.org>
Date: Sat Apr 01 01:37:52 2017

DevTools: carefully cleanup javascript sourcemaps

This patch starts to detach JavaScript sourcemaps as the
associated scripts go away (e.g. parent frame got detached).

This patch makes javascript sourcemap management similar to
CSS domain:
- debuggerModel now has sourceMapManager
- CompilerScriptMapping listens only to SourceMapManager events

A few key differences arose:
- We make sure that there's only one sourceMap per
  (executionContext, script.sourceURL, script.sourceMapURL).
  This is to support "browsersync" scenario and "hot script reload".
- Since CompilerScriptMapping has a need for stubProjects,
  SourceMapManager is taught to send SourceMapWillAttach and
  SourceMapFailedToAttach events.

BUG=670180,  685552 
R=dgozman

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

[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-bindings-multiple-frames-expected.txt
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/sourcemap-navigator-multiple-frames-expected.txt
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/worker-debugging-script-mapping.html
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/js-sourcemaps-toggle-enabled-expected.txt
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/js-sourcemaps-toggle-enabled.html
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/sourcemap-script.js
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/sourcemap-script.js.map
[add] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/http/tests/inspector/sources/resources/sourcemap-typescript.ts
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/platform/utilities.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
[modify] https://crrev.com/625244e25254fb6479b3122d92145c596616a196/third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js

Status: Fixed (was: Assigned)
This should be now fixed.

Sign in to add a comment