Repository navigation
Closed
Labels
Description
Versions
Not using ng, just using @ngtools/webpack with webpack.
Repro steps
tsconfig.aot.json
{
"compilerOptions": {
"skipLibCheck": true,
"outDir": "build/aot",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"lib": [
"es5",
"es6",
"dom",
"es2015.collection",
"es2015.promise",
"es2015.core",
"es2016",
"es2017"
]
},
"includes": [
"src/angular/**/*",
"test/angular-webpack/**/*"
],
"exclude": [
"node_modules",
"src/angular/boot.ts",
"test/angular-webpack/angular/boot.ts",
"build/browser"
],
"angularCompilerOptions": {
"annotationsAs": "decorators",
"preserveWhitespaces": false
}
}Observed behavior
ERROR in Error: TypeError: Cannot read property 'getTsProgram' of undefined
at AngularCompilerPlugin._getTsProgram (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:186:62)
at getTypeChecker (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:487:43)
at ast_helpers_1.collectDeepNodes.filter (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/transformers/remove_decorators.js:14:60)
at Array.filter (<anonymous>:null:null)
at standardTransform (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/transformers/remove_decorators.js:14:14)
at transformer (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/transformers/make_transform.js:14:25)
at /home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:2492:86
at reduceLeft (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:2188:30)
at /home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:2492:42
at transformRoot (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:63602:82)
at Object.map (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:1696:29)
at Object.transformNodes (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:63590:30)
at Object.emitFiles (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:66273:28)
at emitWorker (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:69725:33)
at /home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:69687:66
at runWithCancellationToken (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:69779:24)
at Object.emit (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/typescript/lib/typescript.js:69687:20)
at defaultEmitCallback (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@angular/compiler-cli/src/transformers/program.js:33:20)
at AngularCompilerProgram.emit (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@angular/compiler-cli/src/transformers/program.js:242:30)
at AngularCompilerPlugin._emit (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:717:49)
at Promise.resolve.then.then.then (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-web/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:553:54)
at <anonymous>:null:null
at process._tickCallback (internal/process/next_tick.js:188:7)
Desired behavior
With Angular 5.0.1 it was working.
Mention any other details that might be useful (optional)
Is @ngtools/webpack behind with Angular 5.0.2 ?
Reacted by Chris3773, Daniel Di Sarli, patrikx3, Jason Schmedes and glemiere
Activity
[-]@ngtools/webpack error since Angular 5.0.2[/-][+]@ngtools/webpack v1.8.2 error since Angular 5.0.2 [/+]p3x-robot commentedon Nov 17, 2017
Ok, i confirmed,
Angular 5.0.2is not broken, only@ngtools/webpackis broken in1.8.2and1.8.3. With1.8.0it works.[-]@ngtools/webpack v1.8.2 error since Angular 5.0.2 [/-][+]@ngtools/webpack v1.8.2-1.8.3 error since Angular 5.0.2 [/+]filipesilva commentedon Nov 22, 2017
Heya, I can reproduce this issue with our tests that use the plugin by itself.
Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app app that uses the plugin with a simplified webpack config and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
p3x-robot commentedon Nov 23, 2017
heya!
Heya, I can reproduce this issue with our tests that use the plugin by itself.you mean
Heya, I cannot reproduce this issue with our tests that use the plugin by itself.
Is that what you are saying?
filipesilva commentedon Nov 23, 2017
Yes, that is what I meant. Sorry for the confusion 😞
p3x-robot commentedon Dec 1, 2017
Well, you can built it like this:
With 1.8.0 it works, with 1.8.5 is not, same error.
The webpack settings are in
https://github.com/patrikx3/corifeus-builder-angular/tree/master/src/config/webpack/angular
Now if you change at
corifeus-builder-angular/package.jsonand change@ngtools/webpackto1.8.5you can observe that it is that error.I guess you still have to go to
corifeus-builder-angulardirectory and:Then go to
cd corifeus-web-materialNow you get the same error. Is it in the webpack that changed? Or the
tsconfig.json?Here are the files the are connected to
@ngtools/webpack:https://github.com/patrikx3/corifeus-builder-angular/blob/master/src/config/webpack/angular/prod.js
(it is using
AngularCompilerPlugin)https://github.com/patrikx3/corifeus-web-material/blob/master/tsconfig.aot.json
Is something changed?
danieleds commentedon Dec 10, 2017
Still same error on 1.9.0
p3x-robot commentedon Dec 15, 2017
I have given the repro steps, now it is Angular 5.1.1 and 1.9 and it is the same error. With a simple test it works, but given I have a complex repo I have no idea what the error is. Right now it doesn't even show what the error is in my repo, it is all about
angular-cliand@ngtools/webpackandtypescript.Very fishy. Is there something changed, I need a new decorator or what? I can't find the error.
With
1.8.0it works as expected.I guess you could understand more about the
@ngtools/webpackinternals why it throws these errors.If I build it with
patrikx3/corifeus-weband change@ngtools/webpackto1.9.0it works, but when I move topatrikx3/corifeus-web-materialthen it is not working. Maybe it isAngular Material?12 remaining items
getsaf commentedon Feb 10, 2018
Seeing the same thing here.
Switching
skipCodeGenerationtofalsebrings the decorators back but I lose template type-checking amongst other niceties of template codegen.p3x-robot commentedon Feb 10, 2018
ciao!
how are you?
so what it means
loose template type-checking amongst other niceties of template codegen?bigger bundle?
p3x-robot commentedon Feb 10, 2018
@getsaf no change at all, same error
getsaf commentedon Feb 10, 2018
@p3x-robot I mean template type-safety checks aren't run so any template errors aren't caught during the build.
I do see the decorators and inlined html/scss in the output when I turn the flag off. I'm working in a rather large project with multiple teams so type checking the templates is necessary. I need a fix for this soon.
p3x-robot commentedon Mar 8, 2018
For now, I created a hack:
https://gist.github.com/p3x-robot/e12ed76acb7033638b4179149546bb73
p3x-robot commentedon Mar 8, 2018
It works, with all latest versions, including Typescript 2.7.x
p3x-robot commentedon Mar 24, 2018
#10059
anbaran commentedon Sep 14, 2018
Hi. I saw you have the same issue with AOT compiling and you also use Grunt with grunt-webpack. You might be interested to the issues I created:
#12248
And most importantly here: danez/grunt-webpack#168
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.