Skip to content

Incompatibility of @ngtools/webpack@1.2.6 with angular-cli@1.0.0-beta.26 #4352

@darkkean

Description

@darkkean

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

OSX El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.26
node: 7.4.0
os: darwin x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/compiler-cli: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/platform-server: 2.4.5
@angular/router: 3.4.5
@ngtools/json-schema: 1.0.1
@ngtools/webpack: 1.2.4

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Yes

The log given by the failure.

Normally this include a stack trace and some more information.

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at createSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:14546:109)
    at parseSourceFileWorker (/frontend-ng2/node_modules/typescript/lib/typescript.js:14478:26)
    at Object.parseSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:14427:26)
    at Object.createSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:14282:29)
    at WebpackCompilerHost.getSourceFile (/frontend-ng2/node_modules/@ngtools/webpack/src/compiler_host.js:293:27)
    at findSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:63447:29)
    at processSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:63378:27)
    at /frontend-ng2/node_modules/typescript/lib/typescript.js:63488:17
    at Object.forEach (/frontend-ng2/node_modules/typescript/lib/typescript.js:1293:30)
    at processReferencedFiles (/frontend-ng2/node_modules/typescript/lib/typescript.js:63486:16)
    at findSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:63471:21)
    at processSourceFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:63378:27)
    at processRootFile (/frontend-ng2/node_modules/typescript/lib/typescript.js:63265:13)
    at /frontend-ng2/node_modules/typescript/lib/typescript.js:62614:60
    at Object.forEach (/frontend-ng2/node_modules/typescript/lib/typescript.js:1293:30)
    at Object.createProgram (/frontend-ng2/node_modules/typescript/lib/typescript.js:62614:16)
    at AotPlugin._setupOptions (/frontend-ng2/node_modules/@ngtools/webpack/src/plugin.js:161:28)
    at new AotPlugin (/frontend-ng2/node_modules/@ngtools/webpack/src/plugin.js:21:14)
    at Object.exports.getWebpackNonAotConfigPartial (/frontend-ng2/node_modules/angular-cli/models/webpack-build-typescript.js:25:13)
    at new NgCliWebpackConfig (/frontend-ng2/node_modules/angular-cli/models/webpack-config.js:41:46)
    at Class.run (/frontend-ng2/node_modules/angular-cli/tasks/serve-webpack.js:23:22)
    at /frontend-ng2/node_modules/angular-cli/commands/serve.run.js:37:22
    at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.

My package.json's dependencies are:

"dependencies": {
    "@angular/common": "~2.4.0",
    "@angular/compiler": "~2.4.0",
    "@angular/compiler-cli": "^2.4.3",
    "@angular/core": "~2.4.0",
    "@angular/forms": "~2.4.0",
    "@angular/http": "~2.4.0",
    "@angular/platform-browser": "~2.4.0",
    "@angular/platform-browser-dynamic": "~2.4.0",
    "@angular/platform-server": "^2.4.3",
    "@angular/router": "~3.4.0",
    "@ng-idle/core": "^2.0.0-beta.4",
    "@ng-idle/keepalive": "^2.0.0-beta.4",
    "core-js": "^2.4.1",
    "moment": "^2.13.0",
    "ng2-bootstrap": "^1.0.22",
    "ng2-device-detector": "^0.1.0",
    "numeral": "^2.0.4",
    "reflect-metadata": "^0.1.8",
    "rxjs": "^5.0.1",
    "ts-helpers": "^1.1.1",
    "typescript": "^2.0.10",
    "zone.js": "^0.7.4"
  },

In order to run a successful ng serve, I would need to explicitly set which version of @ngtools/webpack to download. So I downgraded it back to: 1.2.4.

"@ngtools/webpack": "1.2.4",

Thanks! We'll be in touch soon.

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