Skip to content

Rebuilding project with errors reports cannot find .ts files #14644

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
jtsom opened this issue Jun 3, 2019 · 1 comment · Fixed by #14658
Closed

Rebuilding project with errors reports cannot find .ts files #14644

jtsom opened this issue Jun 3, 2019 · 1 comment · Fixed by #14658

Comments

@jtsom
Copy link
Contributor

jtsom commented Jun 3, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [X] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes

7.x

Description

With a project that has build errors (after updating to V8), with ng serve running, correcting one error and saving the file causes the project to rebuild, but report that it cannot find the main.ts files:

ERROR in ./src/main.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Users/john/Dev/Javascript/Angular/FRC-TimeTracker/src/main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (/Users/john/Dev/Javascript/Angular/FRC-TimeTracker/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:834:23)
    at /Users/john/Dev/Javascript/Angular/FRC-TimeTracker/node_modules/@ngtools/webpack/src/loader.js:41:31
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
ERROR in ./src/polyfills.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Users/john/Dev/Javascript/Angular/FRC-TimeTracker/src/polyfills.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (/Users/john/Dev/Javascript/Angular/FRC-TimeTracker/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:834:23)
    at /Users/john/Dev/Javascript/Angular/FRC-TimeTracker/node_modules/@ngtools/webpack/src/loader.js:41:31
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
ℹ 「wdm」: Failed to compile.
    

After the first ng serveother than the build errors (below), the above errors do not happen.

My build errors

   ERROR in src/app/apparel/add-apparel/add-apparel.component.ts(25,4): error TS2554: Expected 2 arguments, but got 1.
    src/app/events/add-edit-event.component.ts(23,4): error TS2554: Expected 2 arguments, but got 1.
    src/app/message/edit-message/edit-message.component.ts(25,4): error TS2554: Expected 2 arguments, but got 1.
    src/app/message/message-list/message-list.component.ts(18,4): error TS2554: Expected 2 arguments, but got 1.
    src/app/reports/student-hours-report.component.ts(21,4): error TS2554: Expected 2 arguments, but got 1.
    src/app/shared/alert-message/alert-message.component.ts(9,4): error TS2554: Expected 2 arguments, but got 1.
    src/app/shared/image-upload/image-upload-service.service.ts(2,22): error TS2307: Cannot find module '@angular/http'.
    src/app/student/student-list/student-list.component.ts(21,4): error TS2554: Expected 2 arguments, but got 1.

🔬 Minimal Reproduction

🔥 Exception or Error

Shown above.

🌍 Your Environment


ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.0.1
Node: 12.3.1
OS: darwin x64
Angular: 8.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.1
@angular-devkit/build-optimizer   0.800.1
@angular-devkit/build-webpack     0.800.1
@angular-devkit/core              8.0.1
@angular-devkit/schematics        8.0.1
@angular/cli                      8.0.1
@ngtools/webpack                  8.0.1
@schematics/angular               8.0.1
@schematics/update                0.800.1
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

@ngbot ngbot bot added this to the needsTriage milestone Jun 3, 2019
@alan-agius4 alan-agius4 modified the milestones: needsTriage, 8.0.x Jun 3, 2019
@alan-agius4 alan-agius4 self-assigned this Jun 4, 2019
alexeagle pushed a commit that referenced this issue Jun 6, 2019
…find .ts files in JIT

When the first build in JIT has an error we are not emitting files. This ends up causing an issue because subsequent builds only trigger partial emits of files and only emits the full set of files if the number of files changed is greater than 20.

This logic adds the behavior that we only enter the 'only 20 files' part when the previous build was successful.

Fixes #14644
alexeagle pushed a commit that referenced this issue Jun 6, 2019
…find .ts files in JIT

When the first build in JIT has an error we are not emitting files. This ends up causing an issue because subsequent builds only trigger partial emits of files and only emits the full set of files if the number of files changed is greater than 20.

This logic adds the behavior that we only enter the 'only 20 files' part when the previous build was successful.

Fixes #14644
@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 9, 2019
ikjelle pushed a commit to ikjelle/angular-cli that referenced this issue Mar 26, 2024
…find .ts files in JIT

When the first build in JIT has an error we are not emitting files. This ends up causing an issue because subsequent builds only trigger partial emits of files and only emits the full set of files if the number of files changed is greater than 20.

This logic adds the behavior that we only enter the 'only 20 files' part when the previous build was successful.

Fixes angular#14644
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants