Skip to content

TypeError: ɵgetOrCreateAngularServerApp is not a function in 19.1.x after fix angular-compiler error #29458

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
1 task done
Ruisi-Lu opened this issue Jan 23, 2025 · 2 comments · Fixed by #29462
Closed
1 task done
Assignees

Comments

@Ruisi-Lu
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

No response

Description

Throw error message when hot reload in 19.1.x, this issue still exists in v19.1.4.

Image

Image

#29379 (comment)

Minimal Reproduction

  1. Edit the project to throw angular-compiler error.
    eg.
    X [ERROR] NG5002: Unexpected character "}" [plugin angular-compiler]
    or
    X [ERROR] TS1128: Declaration or statement expected. [plugin angular-compiler]
  2. Fix the code.
  3. Observe the error in the terminal and the browser.

Exception or Error

TypeError: ɵgetOrCreateAngularServerApp is not a function
    at _AngularAppEngine.getAngularServerAppForRequest (C:\Project\rosy-cart\.angular\cache\19.1.4\rosy-cart\vite\deps_ssr\chunk-VBOT64B7.js:11367:23)
    at async _AngularAppEngine.handle (C:\Project\rosy-cart\.angular\cache\19.1.4\rosy-cart\vite\deps_ssr\chunk-VBOT64B7.js:11306:23)

Your Environment

Angular CLI: 19.1.4
Node: 20.18.1
Package Manager: pnpm 10.0.0
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.4
@angular-devkit/build-angular   19.1.4
@angular-devkit/core            19.1.4
@angular-devkit/schematics      19.1.4
@angular/cli                    19.1.4
@angular/ssr                    19.1.4
@schematics/angular             19.1.4
rxjs                            7.8.1
typescript                      5.5.4

Anything else relevant?

No response

@alan-agius4 alan-agius4 self-assigned this Jan 23, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 23, 2025
Ensure that accessing the module after invalidation doesn't result in an empty module, which causes a `TypeError: ɵgetOrCreateAngularServerApp is not a function`.

Closes angular#29458
alan-agius4 added a commit that referenced this issue Jan 23, 2025
Ensure that accessing the module after invalidation doesn't result in an empty module, which causes a `TypeError: ɵgetOrCreateAngularServerApp is not a function`.

Closes #29458

(cherry picked from commit 8e884a0)
@Mohamed-sabry-av
Copy link

how did you solve this ?

@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 Mar 17, 2025
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.

3 participants