Skip to content

Error: ɵgetOrCreateAngularServerApp is not a function - dev server stops updating if the user saves while the HTML is in an invalid state #31671

@Wycza

Description

@Wycza

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

18

Description

I am encountering the following error in my Angular app:

TypeError: ɵgetOrCreateAngularServerApp is not a function at _AngularAppEngine.getAngularServerAppForRequest (D:\Repozytoria\angular-bug\.angular\cache\20.3.8\bug\vite\deps_ssr\chunk-D4GEBLTE.js:29464:23) at async _AngularAppEngine.handle (D:\Repozytoria\angular-bug\.angular\cache\20.3.8\bug\vite\deps_ssr\chunk-D4GEBLTE.js:29407:23)

This error occurs frequently in the larger project I am working on, but it is very difficult to reproduce in a small, isolated project. I managed to create reproduction repository. I am pretty sure, that this error didn't exist in version > 19

This is excactly the same like this issue: #29907

Minimal Reproduction

Steps to reproduce the issue:

  1. Clone https://github.com/Wycza/angular-bug-getOrCreateAngularServerApp
  2. Install dependencies
  3. Run the server
  4. Open localhost:4200
  5. Change something which will produce error in template, e.g. in index.component.html file and save it
  6. Redo change so it is the valid template again
  7. Sometimes, you have to repeat steps 5-6 many times or even kill the app and rerun it again.
  8. After couple of tries you should see TypeError: ɵgetOrCreateAngularServerApp is not a function at _AngularAppEngine.getAngularServerAppForRequest (D:\Repozytoria\angular-bug\.angular\cache\20.3.8\bug\vite\deps_ssr\chunk-D4GEBLTE.js:29464:23) at async _AngularAppEngine.handle (D:\Repozytoria\angular-bug\.angular\cache\20.3.8\bug\vite\deps_ssr\chunk-D4GEBLTE.js:29407:23) - after this error the browser won't refresh by its own, I have to do it manually - in big project it occurs very often which is very annoying

I was not able to post the video here so I've added it to the repository:

https://github.com/Wycza/angular-bug-getOrCreateAngularServerApp/blob/main/video/Recording%202025-11-02%20180915.mp4

Exception or Error

TypeError: ɵgetOrCreateAngularServerApp is not a function at _AngularAppEngine.getAngularServerAppForRequest (D:\Repozytoria\angular-bug\.angular\cache\20.3.8\bug\vite\deps_ssr\chunk-D4GEBLTE.js:29464:23)   at async _AngularAppEngine.handle (D:\Repozytoria\angular-bug\.angular\cache\20.3.8\bug\vite\deps_ssr\chunk-D4GEBLTE.js:29407:23)

Your Environment

Angular CLI: 20.3.8
Node: 24.11.0
Package Manager: npm 11.6.1
OS: win32 x64


Angular: 20.3.9
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-server, router

Package                      Version
------------------------------------
@angular-devkit/architect    0.2003.8
@angular-devkit/core         20.3.8
@angular-devkit/schematics   20.3.8
@angular/build               20.3.8
@angular/cdk                 20.2.11
@angular/cli                 20.3.8
@angular/material            20.2.11
@angular/ssr                 20.3.8
@angular/youtube-player      20.2.11
@schematics/angular          20.3.8
rxjs                         7.8.2
typescript                   5.9.3

Anything else relevant?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions