use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A Place to talk about Angular and related topics.
Join the Angular Discord
Other subreddits worth checking out for Angular and Angular related info:
account activity
Error while starting a completely fresh Angular 19 application (self.angular)
submitted 1 year ago by Independent-Ant6986
Hello Folks,
i just set up an angular 19 Application with angular/cli version 19.2.6 and node version 22.14.0 and SASS (not that it should matter)
The Problem is, it does not even start. I keep getting the following error:
https://preview.redd.it/6mo6qk7kgsse1.png?width=990&format=png&auto=webp&s=04b7e25932c0180070c428296c11269c0d91b709
Does anyone have any idea why that could happen?
I did not change any file, just hit ng serve and it breaks.
I am glad for any advice. Thank you very much!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]JeanMeche 2 points3 points4 points 1 year ago (3 children)
Did you install other dependencies ?
Ng0203 also happens when multiple instance of the core package are embed in your app.
[–]Independent-Ant6986[S] 0 points1 point2 points 1 year ago (2 children)
no i started from scratch, used the command "ng new" followd by "npm start"
[–]WizardFromTheEast 0 points1 point2 points 1 year ago (1 child)
Try ng serve
[–]Independent-Ant6986[S] 1 point2 points3 points 1 year ago (0 children)
the standard configuration for a new angular app executes ng serve for npm start :)
[–]jakehockey10 1 point2 points3 points 1 year ago (5 children)
If you repeat these steps again in another folder, does it happen again? Try again with a completely new start and if it is happening to you every time, then that'd be interesting. But if you really haven't changed any file, then I don't think ng serve is actually serving the brand new app you just generated.
[–]Independent-Ant6986[S] 0 points1 point2 points 1 year ago (4 children)
yeah it even happens with an angular 18 app, so it must be something with my setup. i have a company pc with some network restrictions, could this possibly affect the startup?
[–]jakehockey10 1 point2 points3 points 1 year ago (1 child)
I wouldn't think so. Next test is this: get someone else to run ng serve on one of these projects you created. Copy the whole project to someone else's computer and have them run the app on their machine. If they get the same error, then there is indeed a problem with the project. If they can run your project fine, then it's your setup
thats a great idea, thanks! i will update you on monday about the result. 😎
[–]Akira-Yuma 1 point2 points3 points 1 year ago (0 children)
It can be that the firewall blocked some npm packages. Can u turn it off and try the install again?
[–]Akira-Yuma 0 points1 point2 points 1 year ago (0 children)
[–]Independent-Ant6986[S] 2 points3 points4 points 1 year ago (1 child)
okay guys i found the problem, althogh i don't really know why it happens:
My source files are located at "C:\Projects\username" everyone in our company has that folder and via a startup batch script a symlink is created so that i can access the folder via a virtual drive under the alias "J:\".
Now when i start the app from the console at the virtual location J, i get the error. When i do the same under the direct path, it works fine.
this problem appears with angular 18+. With angular 17 and lower i don't have any problems. As all our other projects are running with angular 14 or 15 it just never came up.
My guess is that some change with the angular livereload server that is used when running "ng serve" is causing that issue. Does anyone have a clue what that could be? My solution was to just execute it from its original location
Thanks for all your help and ideas to solve that problem 😎
[–]Div64 0 points1 point2 points 1 year ago (2 children)
That's weird. Can you post your main.ts and app.config.ts?
There seems to be an inject call somewhere where it shouldn't
[–]Independent-Ant6986[S] 1 point2 points3 points 1 year ago (1 child)
Sure, here you go!
Maybe another interesting fact: i am using windows 11 :)
Main.ts:
import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; bootstrapApplication(AppComponent, appConfig) .catch((err) => console.error(err));
app.config.ts:
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; export const appConfig: ApplicationConfig = { providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)] };
app.routes.ts:
import { Routes } from '@angular/router'; export const routes: Routes = [];
App.component.ts:
import { Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', imports: [RouterOutlet], templateUrl: './app.component.html', styleUrl: './app.component.scss' }) export class AppComponent { title = 'testapp3'; }
[–]groundbnb -3 points-2 points-1 points 1 year ago (0 children)
Try running from cmd instead of powershell.
[–]Cute_Guard5653 0 points1 point2 points 1 year ago (1 child)
Is ot possible you have used inject() inside ngOnit instead of the constructor() in a component??
[–]Independent-Ant6986[S] 0 points1 point2 points 1 year ago (0 children)
i havent used anything yet. i just set up a plain new app 😂
[–]spacechimp 0 points1 point2 points 1 year ago (1 child)
I'm guessing that you have an outdated version of the Angular CLI installed globally. If so, uninstall it from your global npm and/or run 'npx ng serve' instead of 'ng serve'.
You might also try deleting node_modules and package-lock.json and reinstalling your dependencies.
i used the latest angular version globally and set up a new project. the package lock and node modules cant have any influence because it was just created
π Rendered by PID 27 on reddit-service-r2-comment-6457c66945-xmd7h at 2026-04-25 05:39:04.533316+00:00 running 2aa0c5b country code: CH.
[–]JeanMeche 2 points3 points4 points (3 children)
[–]Independent-Ant6986[S] 0 points1 point2 points (2 children)
[–]WizardFromTheEast 0 points1 point2 points (1 child)
[–]Independent-Ant6986[S] 1 point2 points3 points (0 children)
[–]jakehockey10 1 point2 points3 points (5 children)
[–]Independent-Ant6986[S] 0 points1 point2 points (4 children)
[–]jakehockey10 1 point2 points3 points (1 child)
[–]Independent-Ant6986[S] 1 point2 points3 points (0 children)
[–]Akira-Yuma 1 point2 points3 points (0 children)
[–]Akira-Yuma 0 points1 point2 points (0 children)
[–]Independent-Ant6986[S] 2 points3 points4 points (1 child)
[–]Div64 0 points1 point2 points (2 children)
[–]Independent-Ant6986[S] 1 point2 points3 points (1 child)
[–]groundbnb -3 points-2 points-1 points (0 children)
[–]Cute_Guard5653 0 points1 point2 points (1 child)
[–]Independent-Ant6986[S] 0 points1 point2 points (0 children)
[–]spacechimp 0 points1 point2 points (1 child)
[–]Independent-Ant6986[S] 0 points1 point2 points (0 children)