🐞 Bug report
Command (mark with an x)
Is this a regression?
Yes, the previous version in which this bug was not present was: 9.x
Description
Somehow typescript loses @types/* types on second+ angular app rebuild. It works fine on devserver start, first rebuild and on build command.
We faced this for require and some webpack typings in our apps after update ng9 -> ng10.
🔬 Minimal Reproduction
Adding types: ['node'] solves require type error, but you need to add all @types/* packages for big projects. @types/* should work fine without any additional actions.
🔥 Exception or Error
ERROR in src/app/app.component.ts:2:1 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`.
2 require('./test.svg');
~~~~~~~
🌍 Your Environment
PS D:\projects\issues\angular-cli-missing-types-on-rebuild> yarn ng version
yarn run v1.16.0
$ ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 10.1.2
Node: 12.18.1
OS: win32 x64
Angular: 10.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1001.2
@angular-devkit/build-angular 0.1001.2
@angular-devkit/core 10.1.2
@angular-devkit/schematics 10.1.2
@schematics/angular 10.1.2
@schematics/update 0.1001.2
rxjs 6.6.3
typescript 4.0.3
Anything else relevant?
🐞 Bug report
Command (mark with an
x)Is this a regression?
Yes, the previous version in which this bug was not present was: 9.xDescription
Somehow typescript loses
@types/*types on second+ angular app rebuild. It works fine on devserver start, first rebuild and on build command.We faced this for
requireand some webpack typings in our apps after update ng9 -> ng10.🔬 Minimal Reproduction
Adding
types: ['node']solvesrequiretype error, but you need to add all@types/*packages for big projects.@types/*should work fine without any additional actions.🔥 Exception or Error
🌍 Your Environment
Anything else relevant?