Skip to content

@ngtools/webpack HMR compilation errors ignored #15372

Closed
@kukjevov

Description

@kukjevov

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

not using angular cli, but @ngtools/webpack

Is this a regression?

Dont know if this ever worked with @ngtools/webpack because i havent been using it during development before.

Description

When you create compilation error in project, like you add some unused import, compilation throws error in console, but this error is not displayed in WebpackNotifierPlugin nor in browser through HMR. When you use awesome-typescript-loader it works correctly.

What is even weirder is that if you stop compilation process and run it again, error is thrown correctly everywhere, only during HMR change it is not handled correctly.

If you fix initial problem and HMR is running you will get error

from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

and you have to restart npm start command. All three mentioned things are slowing development with @ngtools/webpack compared to awesome-typescript-loader.

🔬 Minimal Reproduction

download this https://github.com/kukjevov/ngtools-error

#1

git clone https://github.com/kukjevov/ngtools-error
cd ngtools-error
npm install
npm start
open in browser http://localhost:8888 add ChangeDetectorRefintonavigation.component.ts` into import statement
save file
you can see error in system console, but no error in browser, nor in WebpackNotifierWindow

#2

stop npm start
run npm start again
you will see error in system notification window
refresh browser http://localhost:8888
you will see also in browser

#3

open navigation.component.ts and remove unused ChangeDetectorRef from import statement
save file
you can see error in system console, this errors dissapears after you restart npm start

🔥 Exception or Error

See minimal reproduction part

🌍 Your Environment

  • angular: 9.0.0-next.2
  • @ngtools/webpack: 8.3.0-rc.0
  • node: 10.16.0
  • npm: 6.9.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions