angular: AOT compilation with allowJs: true fails in 5.0.0-rc.2

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

AOT compilation fails with "allowJs": true.

Expected behavior

AOT compilation works with "allowJs": true.

Minimal reproduction of the problem with instructions

git clone https://github.com/filipesilva/ngc-allowjs
cd ngc-allowjs
npm i
npm run ngc # for ngc failure
npm run ng -- build --aot # for angular cli failure
# remove "allowJs": false from src/tsconfig.app.json to make these builds work again

What is the motivation / use case for changing the behavior?

Environment


Angular version: 1.5.0-rc.2


Browser:
- [x] Chrome (desktop) version 61
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  6.11.1
- Platform:  Windows 10

Others:

Compilation fails in different ways with ngc or Angular CLI.

For ngc:

kamik@T460p MINGW64 /d/sandbox/ngc-allowjs
$ npm run ngc

> master-project@0.0.0 ngc D:\sandbox\ngc-allowjs
> ngc -p src/tsconfig.ngc.json

Error: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:9432:17)
    at assignContextualParameterTypes (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:37839:25)
    at checkFunctionExpressionOrObjectLiteralMethod (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38136:29)
    at checkExpressionWorker (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39148:28)
    at checkExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39077:42)
    at checkBinaryLikeExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38657:29)
    at checkBinaryExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38649:20)
    at checkExpressionWorker (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39169:28)
    at checkExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39077:42)
    at checkBinaryLikeExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38657:29)

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! master-project@0.0.0 ngc: `ngc -p src/tsconfig.ngc.json`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the master-project@0.0.0 ngc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kamik\AppData\Roaming\npm-cache\_logs\2017-10-17T10_14_11_075Z-debug.log

For Angular CLI:

kamik@T460p MINGW64 /d/sandbox/ngc-allowjs
$ npm run ng -- build --aot

> master-project@0.0.0 ng D:\sandbox\ngc-allowjs
> ng "build" "--aot"

Date: 2017-10-17T10:12:58.261Z
Hash: 80e92f8d9f5182151fab
Time: 5342ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 557 bytes [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 577 bytes {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 11.3 kB {inline} [initial] [rendered]

ERROR in ./src/main.ts
Module build failed: Error: TypeScript compilation failed.
    at plugin.done.then (D:\sandbox\ngc-allowjs\node_modules\@ngtools\webpack\src\loader.js:479:27)
    at process._tickCallback (internal/process/next_tick.js:109:7)
 @ multi ./src/main.ts
ERROR in ./src/polyfills.ts
Module build failed: Error: TypeScript compilation failed.
    at plugin.done.then (D:\sandbox\ngc-allowjs\node_modules\@ngtools\webpack\src\loader.js:479:27)
    at process._tickCallback (internal/process/next_tick.js:109:7)
 @ multi ./src/polyfills.ts
ERROR in error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/es6/reflect.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/es7/reflect.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_a-function.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_an-instance.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_an-object.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_array-from-iterable.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_array-includes.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_array-methods.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_array-species-constructor.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_array-species-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_bind.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_classof.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_cof.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_collection-strong.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_collection-weak.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_collection.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_core.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_ctx.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_defined.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_descriptors.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_dom-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_enum-bug-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_export.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_fails.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_for-of.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_global.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_has.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_hide.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_html.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_ie8-dom-define.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_inherit-if-required.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_invoke.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iobject.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_is-array-iter.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_is-array.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_is-object.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iter-call.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iter-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iter-define.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iter-detect.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iter-step.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_iterators.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_library.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_meta.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-assign.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-create.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-dp.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-dps.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-gopd.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-gopn.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-gops.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-gpo.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-keys-internal.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_object-pie.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_own-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_property-desc.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_redefine-all.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_redefine.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_set-proto.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_set-species.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_set-to-string-tag.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_shared-key.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_shared.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_to-absolute-index.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_to-integer.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_to-iobject.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_to-length.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_to-object.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_to-primitive.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_uid.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_validate-collection.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/_wks.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/core.get-iterator-method.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.map.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.apply.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.construct.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.define-property.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.delete-property.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.enumerate.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.get-prototype-of.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.get.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.has.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.is-extensible.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.own-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.prevent-extensions.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.set-prototype-of.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.reflect.set.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.set.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es6.weak-map.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.define-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.delete-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.get-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.get-own-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.has-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.has-own-metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/core-js/modules/es7.reflect.metadata.js' because it would overwrite input file.
error TS5055: Cannot write file 'D:/sandbox/ngc-allowjs/node_modules/zone.js/dist/zone.js' because it would overwrite input file.
Error: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:9432:17)
    at assignContextualParameterTypes (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:37839:25)
    at checkFunctionExpressionOrObjectLiteralMethod (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38136:29)
    at checkExpressionWorker (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39148:28)
    at checkExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39077:42)
    at checkBinaryLikeExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38657:29)
    at checkBinaryExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38649:20)
    at checkExpressionWorker (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39169:28)
    at checkExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39077:42)
    at checkBinaryLikeExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38657:29)
    at checkBinaryExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:38649:20)
    at checkExpressionWorker (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39169:28)
    at checkExpression (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:39077:42)
    at checkExpressionStatement (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:41199:13)
    at checkSourceElement (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:43009:28)
    at Object.forEach (D:\sandbox\ngc-allowjs\node_modules\typescript\lib\typescript.js:1500:30)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! master-project@0.0.0 ng: `ng "build" "--aot"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the master-project@0.0.0 ng script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kamik\AppData\Roaming\npm-cache\_logs\2017-10-17T10_12_58_308Z-debug.log

Original issue in https://github.com/angular/angular-cli/issues/8061.

/cc @tbosch

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 30
  • Comments: 62 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Also been waiting for the fix… Can’t upgrade to Angular 5 unless this is fixed

Hey, it’s been another week and as far as I can tell I can’t use Angular 5 in a project that includes JS code. I definitely can’t be the only one that needs allowJs, right? Is anybody else coping with this? I’m getting really concerned now, because the latest Material2 release addresses some issues I’ve been having, but now requires Angular 5.

I think it is quite clear that it is about allowJs. However clearly not everyone here can simply disable it.

Thanks.

build success I removed allowJs,here my ts.config.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

package.json:

{
    "@angular/animations": "5.0.0",
    "@angular/cdk": "5.0.0-rc.2",
    "@angular/common": "5.0.0",
    "@angular/compiler": "5.0.0",
    "@angular/compiler-cli": "5.0.0",
    "@angular/core": "5.0.0",
    "@angular/forms": "5.0.0",
    "@angular/http": "5.0.0",
    "@angular/material": "5.0.0-rc.2",
    "@angular/platform-browser": "5.0.0",
    "@angular/platform-browser-dynamic": "5.0.0",
    "@angular/platform-server": "5.0.0",
    "@angular/router": "5.0.0",
    "@types/jquery": "3.2.16",
    "@types/node": "6.0.90",
    "core-js": "2.5.1",
    "css-loader": "0.28.7",
    "echarts": "3.8.5",
    "flatpickr": "4.0.7",
    "font-awesome": "4.7.0",
    "hammerjs": "2.0.8",
    "jQuery.print": "1.5.1",
    "jquery": "3.2.1",
    "jsencrypt": "^2.3.1",
    "ng2-dragula": "1.5.0",
    "ngx-webstorage": "2.0.0",
    "node-sass": "4.6.0",
    "rxjs": "5.5.2",
    "typescript": "2.4.2",
    "viewerjs": "0.10.0",
    "wangeditor": "3.0.13",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@angular/cli": "1.5.0",
    "@angular/compiler-cli": "5.0.0",
    "@angular/language-service": "5.0.0",
    "@types/jasmine": "2.6.3",
    "@types/jasminewd2": "2.0.3",
    "@types/node": "8.0.50",
    "codelyzer": "4.0.1",
    "jasmine-core": "2.8.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "1.7.1",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.3.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "protractor": "5.2.0",
    "ts-node": "3.3.0",
    "tslint": "5.8.0"
  }

Hope it helps you!

I think this is a huge blocker for anyone migrating to the CLI with a hybrid app, which I think is a lot of people. My team has a little bit of time to improve the build system with our hybrid Angular 5 project, so we’re trying to put the CLI in it but we can’t because we have a ton of JS files that we don’t have time to convert to TS.

When allowJs is true, we get

Cannot write file [file.js] because it would overwrite input file.

When allowJs is false, we get

Module '../utils/filter' was resolved to '[path_to_file]/filter.js', but '--allowJs' is not set.

Just to check, does this mean I can’t migrate to 5.0 yet if my application uses a mix of TS and JS? If I leave allowJs on, I get this error on everything in node_modules. If I turn it off, my TS code can’t resolve the imports it’s trying to make from my JS code.

I just reached out to some folks on the Angular team to see if we can get an update on the prioritization of this issue. I am not requesting it become their top priority. I am only asking that they take a stab at setting our expectations on this issue. Like many folks here, it sounds like this is a big deal for a lot of people, and i am certainly blocked by the same issue. If I hear anything back, I will post an update here. @mfp22 @billyjacobs2014 @thw0rted @hellraisercenobit @bengoldsh @falcoprescher @itsnotvalid @Git-DN @sarpera @chitti-reddy

**

“Just to check, does this mean I can’t migrate to 5.0 yet if my application uses a mix of TS and JS? If I leave allowJs on, I get this error on everything in node_modules. If I turn it off, my TS code can’t resolve the imports it’s trying to make from my JS code”

**

Any update on this issue. I am also facing same issue while migrating form angular 4 to angular 5

After upgrading to Angule CLI 1.5.2 with a project that uses allowJs: true, I’m seeing this issue, but I’m also seeing it even when I have AOT turned off (by simply running ng build, ng serve, or ng build --aot=false).

Is anyone else seeing this?

Seeing this go unaddressed for so long has made me wonder how common mixed-language projects are. I just assumed that everybody wound up needing to use some native JS at some point, but I also have to assume that if that were the case, we’d see hundreds of users commenting here. Is it really that unusual to need to keep vanilla JS in your project?

Still not fixed in angular 5.1.0

I think we are quite worried as the internals for Angular compiler isn’t that trivial…

Any updates as to when this will be solved? The work around works but randomly fails too, at least with me.

updates on this issue?

OK. I didn’t notice this (thanks to @robwormald for pointing it out) but 3 days ago, it was assigned to @chuckjaz. So… it looks like we are in great hands. Arguably the best of hands. It’s nice to see that we are getting closer on this issue.

I think they solved the issue, I upgraded to the latest angular cli and this fixed the issue. Angular 5.0.0 doesnt work for me

Thx yadue, I was about to do one,below on ng build --prod I am getting these errors, on selecting allowJs false they disappear.

ERROR in error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/assert/assert.js’ because it would Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/base64-js/index.js’ because it would overwr Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/any.js’ because it woul Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/async.js’ because it wo Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/bind.js’ because it wou Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/bluebird.js’ because it Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/call_get.js’ because it Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/cancel.js’ because it w Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files error TS5055: Cannot write file ‘D:/chat/mean-chat/node_modules/bluebird/js/release/catch_filter.js’ becaus

@oudekaas: apparently @chuckjaz already fixed it. AFAIK it will be available in 5.1.2 release (probably this week).

In our company we are currently investigating to upgrade our application from AngularJS to Angular 5+. Since we need to support IE11, performance (and bundle size) is a big issue which we may be able to resolve by using the AoT Compiler. Being in that hybrid state and using only JIT compiler sadly resulted in a roughly 20%+ slower (initial) script execution.

While migrating we came across the same problem mentioned by @itsnotvalid @thw0rted @mfp22 @filipesilva. This is also a blocker preventing us to merge our migration branch to main.

I replied because I am using Material2 as well.

On Fri, 17 Nov 2017 at 4:46 PM James Bromwell notifications@github.com wrote:

Hey, it’s been another week and as far as I can tell I can’t use Angular 5 in a project that includes JS code. I definitely can’t be the only one that needs allowJs, right? Is anybody else coping with this? I’m getting really concerned now, because the latest Material2 release https://github.com/angular/material2/releases addresses some issues I’ve been having, but now requires Angular 5.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular/issues/19757#issuecomment-345181105, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA1fsEUYnvG5T_islpvDVn-CdpvaDtLks5s3UfWgaJpZM4P7603 .

– Alan

@jackjamieson Please try read the thread first before making additional comments, TS5055 error does not belong to this issue and is under track at #21080.

Still does not work for me with Angular 5.2.0 and CLI 1.6.2. I have allowJS set and it throws the TS5055 error cannot write file.

What is the recommendation for now? Should people who needs to allowJS revert to Angular 4 until this gets solved?

Looking back at this issue, it looks like 20+/- days ago people also started commenting on the variation that @yadue was commenting about. A lot of us thought that this ticket represented that problem. When @mfp22 and I started to comment on this (we work together) we didn’t realize that this ticket was for the issue that Chuck fixed. We thought it was for the other issue that @yadue has mentioned. If we had known, we would have entered the ticket back then.

Is there any way that we can get a new ticket prioritized as if it has been entered 20 days ago? The second variation of this problem seems to be affecting more of the commenters than even the first variation that has already been fixed.

@chuckjaz, thoughts?

@thomasSve & @cristianfd --prod builds with --aot set to true by default; hence the same behavior.

I have one JS file… and it has this issue. When I run ng serve, it initially errors on this file. But… as soon as I make an edit to any file, it recompiles, and works the second time. Not sure whats up with that. It bugs me… but it works.

At work, on my work project, however, this issue is totally blocking me. I am not able to simply edit a file to get past the hundreds of errors caused by this issue.

I’m also in a situation where I cannot stop using external JS files, and I’m facing the same issue.

If I run ng serve without the --aot flag this error doesn’t happen.

I just came across a case where I could use this compiler option but have the same problem with allowJs