Repository navigation
Closed
Description
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
Angular CLI: 1.5.0
Node: 8.1.0
OS: darwin x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.5.0
@angular/flex-layout: 2.0.0-beta.10
@angular/material: 2.0.0-beta.12
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.0
typescript: 2.6.1
webpack: 3.8.1
Repro steps.
- Run in terminal:
./node_modules/.bin/ng build --aot --env=dev --watch - -> The build is successful
- Add a new line to any source file
- The build will throw an error:
ERROR in Error: Debug Failure. False expression: Host should not return a redirect source file from `getSourceFile`
at tryReuseStructureFromOldProgram (/node_modules/typescript/lib/typescript.js:72100:26)
at Object.createProgram (/node_modules/typescript/lib/typescript.js:71808:34)
at AngularCompilerProgram._createProgramWithBasicStubs (/node_modules/@angular/compiler-cli/src/transformers/program.js:431:29)
at /node_modules/@angular/compiler-cli/src/transformers/program.js:144:28
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
The log given by the failure.
ERROR in Error: Debug Failure. False expression: Host should not return a redirect source file from `getSourceFile`
at tryReuseStructureFromOldProgram (/node_modules/typescript/lib/typescript.js:72100:26)
at Object.createProgram (/node_modules/typescript/lib/typescript.js:71808:34)
at AngularCompilerProgram._createProgramWithBasicStubs (/node_modules/@angular/compiler-cli/src/transformers/program.js:431:29)
at /node_modules/@angular/compiler-cli/src/transformers/program.js:144:28
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
Desired functionality.
Adding a new line shouldn't break the build
Reacted by Gaurav Mukherjee , Tarek Haoula, km, Wangmeng, Klemen Oslaj, Aleksey Zikrackiy, James Spivey, Anatoliy Siryi, Aaron Ervin and Craig Hutch
Metadata
Metadata
Assignees
Labels
No labels
Activity
thaoula commentedon Nov 8, 2017
Hi Guys,
I also get this issue on change of source code like fixing an import reference.
I am using ng serve --aot
Regards,
Tarek
Hacklone commentedon Nov 8, 2017
I reverted my typescript version to “<2.5.0” and it’s working fine.
Brocco commentedon Nov 10, 2017
The current version of typescript supported is 2.4.2, please use that version for now. Support for later versions of TypeScript are being looked into.
subatomicglue commentedon Nov 13, 2017
When using
typescript 2.4.2withng build -prod, I get this error.(Which the fix here says to upgrade
typescriptto2.6.1.)When using
typescript 2.6.1withng serve --aot, I get the above error when incrementally saving a.htmlor.tsfile(Which the fix above says to downgrade to
typescript 2.4.2...)So I am in a catch 22, where I need
typescript 2.4.2forng serve --aotandtypescript 2.6.1forng build --prod.kevinbuhmann commentedon Dec 19, 2017
See also #8434.
Typescript@next(currently2.7.0-dev.20171216) is needed to fix other issues as well.DcsMarcRemolt commentedon Feb 26, 2018
The same error still shows up for current angular 5.2.x and @ngtools/webpack 1.10.1 if I use a TS version != 2.4.2. As Angular 5.2 officially supports TS 2.6 this is now a real bug, please reopen.
kspearrin commentedon Apr 7, 2018
Same problem here using Typescript 2.6.2, webpack 3.10, Angular 5.2.x with ngtools/webpack 1.10.2 (compiler-cli 5.2).
denishvachhani commentedon May 22, 2018
Same problem here using Typescript 2.7.2, webpack 3.11.0, Angular 5.2.9
ERROR in Error: Debug Failure. False expression: Host should not return a redirect source file fromgetSourceFileat tryReuseStructureFromOldProgram (/node_modules/typescript/lib/typescript.js:74285:26) at Object.createProgram (/node_modules/typescript/lib/typescript.js:73988:34) at AngularCompilerProgram._updateProgramWithTypeCheckStubs (/node_modules/@angular/compiler-cli/src/transformers/program.js:460:30) at /node_modules/@angular/compiler-cli/src/transformers/program.js:148:23 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)klemenoslaj commentedon Jun 19, 2018
@Brocco I understand the issue was closed initially due to TypeScript version mismatch, but it seems like the issue can still be reproduced with 6.0.8, easily. Should this issue be reopened?
coryrylan commentedon Jun 21, 2018
I just ran into this as well on 6.1.0-rc.0
Dunos commentedon Jul 16, 2018
Can confirm this is still a thing with Angular 6.0.9 and CLI 6.0.8, issue should be reopen
glebmachine commentedon Aug 5, 2018
I've got same error on production build
lorado commentedon Sep 7, 2018
When I run project with JIT compilation - cli can build, and the rebuild on changes. When I compile with AOT - first build succeed, but on change cli can't rebuild, and displays
DcsMarcRemolt commentedon Sep 7, 2018
Guys, this ticket is closed and dead. The current ticket tracking the problem is angular/angular#22524
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.