Some typescript source files missing in Sources tab of dev tools when using webpack
Reported by
geoff.ba...@aptiture.com,
Sep 7 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 Steps to reproduce the problem: 1. git clone https://github.com/michaelbazos/tour-of-heroes-webpack ReproCase 2. cd ReproCase 3. npm install 4. npm start 5. Open Chrome 6. Go to http://localhost:3000 7. Hit F12 to open dev tools 8. Go to Sources tab 9. In tree expand webpack://./src/app/hero 10 Observe that the hero.service.ts?XXXX source is available. 11. Observe that there is no hero.ts or hero.ts?XXXX source at that location. What is the expected behavior? I would expect to find the typescript source for the Hero class in this location, as per the source structure. What went wrong? The source for the Hero class (hero.ts) is not viewable in chrome dev tools. Did this work before? N/A Chrome version: 60.0.3112.113 Channel: n/a OS Version: 10.0 Flash Version: Bug report raised as per request on StackOverflow: https://stackoverflow.com/q/46068829/177018 Other stack overflow user reports that this occurs for any class that is instantiated via `new` in another source file.
,
Sep 11 2017
Thanks for the repro case.. appreciate that.
,
Oct 16 2017
,
Dec 5 2017
It is actually not DevTools bug.
Something in build process - typescript or webpack are able to figure out that application does not use Hero type (I mean app does not call Hero constructor - it uses an object with name field as Hero).
As result in generated code you can find following lines:
const core_1 = __webpack_require__(2);
const router_1 = __webpack_require__(28);
const hero_service_1 = __webpack_require__(22);
for following original source:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Hero } from '../hero/hero.model';
import { HeroService } from '../hero/hero.service';
So there is no hero.ts in generated bundle and we can not show it in DevTools.
|
||||
►
Sign in to add a comment |
||||
Comment 1 by ligim...@chromium.org
, Sep 8 2017