Skip to content
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

After ng new (no ssr) ng serve wont compile #26431

Closed
1 task done
brettaio opened this issue Nov 20, 2023 · 3 comments
Closed
1 task done

After ng new (no ssr) ng serve wont compile #26431

brettaio opened this issue Nov 20, 2023 · 3 comments

Comments

@brettaio
Copy link

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

All of em

Description

ng serve

  • Building...X [ERROR] File 'src\main.ts' is missing from the TypeScript compilation. [plugin angular-compiler]

    Ensure the file is part of the TypeScript program via the 'files' or 'include' property.

Application bundle generation failed. [5.327 seconds]
Watch mode enabled. Watching for file changes...

Minimal Reproduction

Using NVM 1.1.11 on windows 11, node v20.9.0 and npm 10.1.0.

Ran 'ng new app-name'

Application was generated,

Ran 'ng serve'

Issue listed below

Exception or Error

ng serve
- Building...X [ERROR] File 'src\main.ts' is missing from the TypeScript compilation. [plugin angular-compiler]

  Ensure the file is part of the TypeScript program via the 'files' or 'include' property.


Application bundle generation failed. [5.327 seconds]
Watch mode enabled. Watching for file changes...

Your Environment

Angular CLI: 17.0.1
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64

Angular: 17.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.1
@angular-devkit/build-angular   17.0.1
@angular-devkit/core            17.0.1
@angular-devkit/schematics      17.0.1
@angular/cli                    17.0.1
@schematics/angular             17.0.1
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else relevant?

I got this to work thanks to ai telling me to "include": ["src/**/*.ts"] to compiler options, but I want to be able to run ng new on a project and serve the starter app, which isn't happening - also the case when generating a new SSR project, out of the box.

@brettaio
Copy link
Author

brettaio commented Nov 20, 2023

I noticed npm -g list @angular/cli is 17.0.1 and @angular/core is 17.0.3 so I am going to make sure -g @angular/core is 17.0.1 and try again

update - this didn't fix issue, still

`Building...X [ERROR] File 'src\main.ts' is missing from the TypeScript compilation. [plugin angular-compiler]

Ensure the file is part of the TypeScript program via the 'files' or 'include' property.
`

@alan-agius4
Copy link
Collaborator

Duplicate of #26379

@alan-agius4 alan-agius4 marked this as a duplicate of #26379 Nov 20, 2023
@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
@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 Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants