GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — `@angular/build:unit-test`: with the default jsdom runner and zone.js, an export from a shared chunk is `undefined` when read during class-field initialisation from a spec with an async test · Issue #33728 · angular/angular-cli Closed Labels area: @angular/buildgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini Milestone DescriptionCommandtest Is this a regression?Not known to be — this is the DescriptionUnder the The distinction that makes it precise:
The binding is live — replacing the fields with getters (reading the same import later) makes the failing test pass with no other change. So the value arrives; at construction time it is not yet visible to the importer, even though the emitted code calls Trigger conditions — each toggled on its own with everything else constant; all four are required:
Not required (removed with the failure surviving): Conditions 3 and 4 are one mechanism: with zone.js present the builder downlevels // spec-…-lead-generator.container.js (dumped with ng test --dump-virtual-files) import { DEALERS, LeadService, init_env_config, init_lead_service } from "./chunk-N64URYIK.js"; import { __async, __commonJS, __esm } from "./chunk-EFV3TZQO.js"; var LeadGeneratorContainer; var init_lead_generator_container = __esm({ "…/lead-generator.container.ts"() { init_services(); init_env_config(); // runs before the class statement below LeadGeneratorContainer = class _LeadGeneratorContainer { leadService = inject(LeadService); dealers = DEALERS; // undefined at construction time dealerOptions = this.dealers.map(…); // throws }; } }); var require_lead_generator_container_spec = __commonJS({ "…/lead-generator.container.spec.ts"(exports) { init_lead_generator_container(); describe("LeadGeneratorContainer", () => { … }); } }); export default require_lead_generator_container_spec(); The shared chunk assigns One caveat for anyone building a paraphrased fixture: the failure is sensitive to inert content — adding a top-level Minimal Reproductionhttps://github.com/jonmarozick/ng-shared-chunk-repro Expected: 2 passed. Actual: Nine source files, dependencies are only Angular 21.2.19 + Vitest 4 + jsdom, Also reproduced by copying these source files unchanged into a fresh Exception or ErrorYour EnvironmentAlso reproduced on Linux CI (ubuntu-latest, Node 24) and in a fresh Anything else relevant?
Activity
MetadataMetadataAssigneesLabelsarea: @angular/buildgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | |||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |