-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Labels
angular/build:unit-testarea: @angular/buildfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: broken
Description
Is this a bug report or a feature request?
- Bug Report
- Feature Request
Please provide the steps to reproduce the issue [Bug Report only]
- Run ng new vitest-test
- Run ng add @angular/localize
- Change signal in app.html to use $localize
Please provide the expected behavior vs the actual behavior you encountered [Bug Report only]
I expected succesful run
Instead it only succeeds when i add import '@angular/localize' to app.ts, I can't do it using setupFiles option.
I suspect that it's because it cant pick up this automatic import when it builds and so i can do it only in app.ts, but i dont have to repeat this import for other components.
Adding vitest configuration with globals option enabled doesn't help either.
Please provide a screenshot if possible [Bug Report only]
No response
Please provide the exception or error you saw [Bug Report only]
######/vitest-test>ng test
Automatically searching for and using Vitest configuration file.
Application bundle generation failed. [0.533 seconds] - 2026-01-06T19:48:08.764Z
✘ [ERROR] TS2304: Cannot find name '$localize'. [plugin angular-compiler]
src/app/app.ts:11:36:
11 │ protected readonly title = signal($localize`vitest-test`);
╵ ~~~~~~~~~
Watch mode enabled. Watching for file changes...
Is this a browser-specific issue? If so, please specify the device, browser, and version. [Bug Report only]
It's vitest related
Description [Feature Request only]
No response
Proposed solution [Feature Request only]
No response
Alternatives considered [Feature Request only]
No response
bschaeublin
Metadata
Metadata
Assignees
Labels
angular/build:unit-testarea: @angular/buildfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: broken