Skip to content

Upgraded to v19 from v18 HMR issue at serve #60287

Closed

Description

@Rafik-Belkadi-Reccap

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

When running nx run client:serve , i'm getting this error after upgrading to v19 :

TypeError: Cannot read properties of undefined (reading 'fileName')
      at extractHmrMetatadata (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_zone.j

here is my config:

 "serve": {
      "configurations": {
        "development": {
          "buildTarget": "client:build:development",
          "hmr": true
        },
        "local": {
          "buildTarget": "client:build:local",
          "hmr": true
        },
        "production": {
          "buildTarget": "client:build:production"
        }
      },

when i disable HMR it solves the issue ..


serve": {
      "configurations": {
        "development": {
          "buildTarget": "client:build:development",
          "hmr": false
        },
        "local": {
          "buildTarget": "client:build:local",
          "hmr": false
        },
        "production": {
          "buildTarget": "client:build:production"
        }
      },

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

✘ [ERROR] Angular compilation emit failed. [plugin angular-compiler]

  TypeError: Cannot read properties of undefined (reading 'fileName')
      at extractHmrMetatadata (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:13881:54)
      at ComponentDecoratorHandler.compileFull (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:14797:38)
      at TraitCompiler.compile (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:2771:38)
      at IvyCompilationVisitor.visitClassDeclaration (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:3080:37)
      at file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:3024:68
      at IvyCompilationVisitor._visitListEntryNode (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:3008:20)
      at IvyCompilationVisitor._visit (file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:3024:26)
      at file:///Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@angular/compiler-cli/bundles/chunk-J2ZUZS7X.js:3022:63
      at visitArrayWorker (/Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:94322:49)
      at visitNodes2 (/Users/rafikbelkadi/Desktop/recapp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:94293:19)

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.2.1
Node: 22.10.0
Package Manager: pnpm 9.1.3
OS: darwin arm64

Angular: 19.2.1
... animations, build, cli, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1902.1 (cli-only)
@angular-devkit/build-angular   19.2.1
@angular-devkit/core            19.2.1
@angular-devkit/schematics      19.2.1
@angular/cdk                    19.2.2
@angular/material               19.2.2
@schematics/angular             19.2.1
ng-packagr                      19.2.0
rxjs                            7.8.2
typescript                      5.7.3
webpack                         5.98.0
zone.js                         0.14.10

Anything else?

No response

Activity

  1. self-assigned this
    on Mar 9, 2025
  2. added
    area: compiler
    on Mar 10, 2025
  3. modified the milestone: needsTriage on Mar 10, 2025
  4. added a commit that references this issue on Mar 10, 2025
    56ee778
  5. added a commit that references this issue on Mar 10, 2025
    23ca885
  6. added a commit that references this issue on Mar 10, 2025
    9be2b33
  7. angular-automatic-lock-bot commented on Apr 10, 2025

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: compilercore: hot module replacement (HMR)state: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions