Skip to content

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

Closed
@p3x-robot

Description

@p3x-robot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions