-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: hot module replacement (HMR)state: has PR
Milestone
Description
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
When project contains enum URL (capital letters) application fails to start with error
"Uncaught TypeError: URL is not a constructor"
This will fail:
import {Component} from '@angular/core';
import {RouterOutlet} from '@angular/router';
export enum URL {
MY = 'MY'
}
@Component({
selector: 'app-root',
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})
export class AppComponent {
title = 'hmr-test';
}Renaming URL to Url or setting hmr: false solves the issue.
Minimal Reproduction
- create new app using version 19
- open app.component.ts and add:
export enum URL { MY = 'MY' } - run ng server
- see aplication failing to run
Exception or Error
"Uncaught TypeError: URL is not a constructor"
Your Environment
Angular CLI: 19.2.12
Node: 22.11.0
Package Manager: npm 10.8.2
OS: win32 x64
Angular: 19.2.11
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1902.12
@angular-devkit/build-angular 19.2.12
@angular-devkit/core 19.2.12
@angular-devkit/schematics 19.2.12
@angular/cli 19.2.12
@schematics/angular 19.2.12
rxjs 7.8.2
typescript 5.7.3
zone.js 0.15.0
Anything else relevant?
No response
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: hot module replacement (HMR)state: has PR