Skip to content

@ngtools/webpack with Angular 5.1.2 and Typescript 2.6.x not working #8983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p3x-robot opened this issue Dec 23, 2017 · 5 comments
Closed

Comments

@p3x-robot
Copy link

p3x-robot commented Dec 23, 2017

Versions

Node 9.3
NPM 5.6

I do not use ng, webpack only with @ngtools/webpack with Grunt.

NCU shows these, if I updated all wrong, but with the latest Angular Material 5.0.2 and latest Angular 5.1.2 it work except this:

patrikx3@workstation:~/Projects/patrikx3/corifeus/corifeus-builder-angular$ ncu
Using /home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/package.json
[..................] - :
 @ngtools/webpack  =1.8.0  →  =1.9.2 
 typescript        =2.5.x  →  =2.6.x 

Run ncu with -u to upgrade package.json

If I upgrade this, it is tons of errors.

With Angular 5.1.2 and TypeScript 2.5.x and @ngtools/webpack 1.8.0 is working, buy with Typescript 2.6.x and @ngtools/webpack 1.9.2 still not working, The application is too complex to give 10 steps, that's the problems. I just get tons of errors, I have exlucded whole node_modules in the tsconfig.aot.js, but still it is giving an error trying to build the boot.ts, which is excluded, it should only use boot.aot.ts, when that is exlucded (boot.ts), but when with TS 2.5.x and @ngtools/webpack 1.8.0 still working Angular 5.1.2 and latest Angular Material.

Not to mentioned that I have given steps and the observed errors, but they have not helped at all.

The older issue is here: #8525

Old error:

ERROR in : TypeError: Cannot read property 'getTsProgram' of undefined
  at AngularCompilerPlugin._getTsProgram (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:188:62)
  at getTypeChecker (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:512:43)
  at ast_helpers_1.collectDeepNodes.filter (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/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-builder-angular/node_modules/@ngtools/webpack/src/transformers/remove_decorators.js:14:14)
  at transformer (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@ngtools/webpack/src/transformers/make_transform.js:14:25)
  at /home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:2601:86
  at reduceLeft (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:2274:30)
  at /home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:2601:42
  at transformRoot (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:65718:82)
  at Object.map (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:1725:29)
  at Object.transformNodes (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:65706:30)
  at Object.emitFiles (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:68440:28)
  at emitWorker (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:72517:33)
  at /home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:72479:66
  at runWithCancellationToken (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:72571:24)
  at Object.emit (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/typescript/lib/typescript.js:72479:20)
  at defaultEmitCallback (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@angular/compiler-cli/src/transformers/program.js:33:20)
  at AngularCompilerProgram.emit (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@angular/compiler-cli/src/transformers/program.js:241:30)
  at AngularCompilerPlugin._emit (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:742:49)
  at Promise.resolve.then.then.then (/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:578:54)
  at <anonymous>:null:null
  at process._tickCallback (internal/process/next_tick.js:160:7)

When I add in Material it gets worse (after Angular 5.1.2, with 5.1.1 at least it was only the getTsProgram problem, but now it looks like this):

ERROR in corifeus-web/src/modules/auth.ts(22,2): Error during template compile of 'AuthService'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Injectable'
    'Injectable' calls 'ɵmakeDecorator'.
test/angular-webpack/angular/bundle.aot.ts(8,31): error TS2307: Cannot find module './module.ngfactory'.

I do not even use tempaltes, it is a service.

@ghobashy
Copy link

Hello @p3x-robot , did you find a solution to that problem, because im using grunt-webpack with angular 5 and ng/tools 1.10.2 and im still getting the getTsProgram undefined issue, no matter what i did its still there. the only solution i have if to add @ngTools/webpack:1.8.0, but then it distory karma untit tests for conflict in ng/tools libs

@p3x-robot
Copy link
Author

@ghobashy
Copy link

Thanks a lot for your fast replay, i thought you reached another solution, lets give it a try with that hack.

@p3x-robot
Copy link
Author

i created a pull merge but they didnt merge it so i deleted, for now where the problem is i know, and i just use this everywhere, all latest versions are working, right now many people are hackingthis or other, but none told me to work 100%, i tried other solution, for me this hack works alway

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants