Meta tags:
description= Command test 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 Reopening from angular/angular#68363 as I don t feel it was ful...;
Headings (most frequently used words):
commented, on, 2026, jul, johncrim, navigation, description, metadata, footer, this, was, testbed, overridecomponent, breaks, module, imports, with, angular, build, unit, test, 33064, menu, repository, activity, issue, actions, command, is, regression, the, previous, version, in, which, bug, not, present, minimal, reproduction, exception, or, error, your, environment, anything, else, relevant, abercrave, may, 29, jeanmeche, assignees, labels, type, projects, milestone, relationships, development,
Text of the page (most frequently used words):
the (93), #angular (84), test (65), builder (33), and (33), component (33), build (32), this (30), that (24), with (22), imports (22), unit (20), #testbed (19), 2026 (17), github (16), for (16), karma (15), bug (15), core (15), new (14), template (14), overridecomponent (14), ___ (14), johncrim (13), devkit (12), jul (11), more (11), issue (10), actions (10), tests (10), legacy (10), aot (10), src (10), packages (10), app (9), compile (9), cmp1 (9), error (9), work (9), from (9), darwin_arm64 (9), fastbuild (9), fdfa778d11ba (9), bin (9), render3 (9), instructions (9), not (8), fails (8), module (8), code (8), vitest (8), cli (8), you (7), can (7), one (7), add (7), standalone (7), was (7), when (7), ngmodule (7), commented (7), element (7), using (7), sut (7), support (6), configuretestingmodule (6), compiler (6), failure (6), out (6), version (6), security (5), copilot (5), sign (5), these (5), all (5), set (5), breaks (5), testhostcomponent (5), but (5), used (5), testing (5), render (5), your (5), running (4), behavior (4), are (4), migrating (4), run (4), testmodule (4), standalonewrappercomponent (4), works (4), true (4), which (4), related (4), same (4), doesn (4), does (4), jeanmeche (4), options (4), runner (4), then (4), div (4), class (4), like (4), should (4), components (4), repro (4), ____ (4), package (4), platform (4), navigation (3), open (3), projects (3), area (3), comment (3), added (3), previous (3), since (3), cases (3), dependencies (3), modules (3), only (3), workaround (3), description (3), overriding (3), get (3), some (3), different (3), separate (3), 65665 (3), last (3), edited (3), here (3), will (3), what (3), custom_elements_schema (3), message (3), spec (3), host (3), await (3), may (3), would (3), common (3), browser (3), our (3), codebase (3), ng0304 (3), change (3), providers (3), don (3), export (3), testcomponent (3), copy (3), link (3), 33064 (3), quality (3), another (3), tab (3), window (3), refresh (3), session (3), reload (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), community (2), status (2), footer (2), pull (2), requests (2), development (2), none (2), milestone (2), type (2), labels (2), metadata (2), already (2), big (2), anyone (2), large (2), deprecated (2), teams (2), trying (2), migrate (2), case (2), repo (2), https (2), com (2), importing (2), via (2), jit (2), child (2), per (2), failures (2), thought (2), enabled (2), help (2), things (2), thanks (2), verified (2), adding (2), issues (2), doing (2), block (2), known (2), verify (2), web (2), schemas (2), suppress (2), data (2), testid (2), fixture (2), createcomponent (2), const (2), compilecomponents (2), declarations (2), async (2), first (2), also (2), lot (2), frustration (2), migration (2), library (2), expected (2), regression (2), still (2), present (2), 48432 (2), than (2), team (2), minimal (2), much (2), found (2), provide (2), reacted (2), john (2), crim (2), react (2), _____ (2), node (2), manager (2), npm (2), operating (2), system (2), installed (2), requested (2), forms (2), service (2), router (2), rxjs (2), typescript (2), environment (2), original (2), detail (2), empty (2), jest (2), any (2), actually (2), happens (2), under (2), reproduction (2), shared (2), exports (2), across (2), abercrave (2), apr (2), response (2), _app (2), validateelementisknown (2), both (2), runners (2), tsconfig (2), json (2), selector (2), import (2), insights (2), 196 (2), repository (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), learn (2), business (2), fixes (2), products (2), secret (2), perform, action, time, share, personal, information, manage, cookies, contact, docs, privacy, terms, inc, branches, yet, relationships, assigned, assignees, have, account, join, conversation, free, commit, references, 6199e7a, improve, stand, statement, changes, deal, number, especially, old, stay, upgrade, path, being, pushed, examined, compilation, default, good, critical, testcmp1, above, calling, succeeds, fix, overlapping, conclusion, covered, find, kind, alarming, valid, just, reading, thread, clear, short, requires, discover, non, checked, correct, seeing, reproduced, described, closely, vite, builds, instead, member, unless, application, bundle, generation, failed, 551, seconds, 05t20, 238z, ng8001, part, plugin, testbednotstandaloneoverrideimports, expectcontainstestcmp1, creates, false, pretty, sure, though, compiles, runs, successfully, experience, confuses, agents, results, cycles, presence, bugs, likely, unnecessary, numbers, messages, misleading, cause, difficult, determine, prevent, easy, use, helpers, string, assuming, counted, unchanged, specific, update, key, points, take, bigger, problem, perceives, guessing, google, isn, otherwise, attention, show, severe, bunch, affected, way, making, verbose, initially, while, working, surprising, scenarios, updating, broken, helpful, darwin, arm64, animations, cdk, language, dynamic, worker, zone, happy, isolated, either, triage, report, triggers, saved, hours, mechanical, gone, sibling, continues, pass, purely, additive, move, level, own, remove, replace, direct, uses, production, silences, leaves, unrendered, breaking, asserts, rendered, output, pre, compiled, against, runtime, modifications, reach, resolution, fires, thereexportedcomponent, workarounds, confirming, scale, real, world, reinforcing, distinct, older, 2022, trigger, effect, override, silently, ignored, destroyed, independent, matches, manifests, unaffected, specs, 225, hit, exact, pattern, concentrated, form, where, feature, existing, clarification, alan, agius4, activity, ben, evans, anything, else, relevant, win32, x64, exception, something, behaviour, originally, discovered, needs, stub, left, simplicity, passes, included, element_validation, 116, 151, initializeelement, 127, ɵɵelementstart, 218, _app_template, templatefn, 109, executetemplate, 107, renderview, rendercomponent, 160, renderchildcomponents, 140, tobetruthy, expect, create, problematic, call, beforeeach, describe, root, plain, project, needed, occur, other, assume, connected, execution, reopening, feel, fully, answered, later, 68363, yes, command, body, opened, yst, ery, items, dismiss, alert, switched, accounts, appearance, settings, search, pricing, event, talks, workshops, next, partners, about, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, see, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, enterprises, stage, businesses, source, latest, improvements, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, tasks, automated, hosting, review, collaboration, menu, skip, content,
Text of the page (random words):
log your source for the latest features improvements and fixes across github products all in one place businesses by stage enterprises team startups nonprofits by industry healthcare financial services manufacturing government see all industries evaluate github why github customer stories business insights trust center add ons github advanced security enterprise grade code security copilot for business enterprise grade ai features premium support enterprise grade 24 7 support resources learn connect documentation resource center blog events webinars community forum customer stories integrations support customer support training github status company about partners changelog github universe github universe the event for developers by developers talks workshops and what s next for github pricing search sign in sign up appearance settings you signed in with another tab or window reload to refresh your session you signed out in another tab or window reload to refresh your session you switched accounts on another tab or window reload to refresh your session dismiss alert message angular angular cli repository navigation code issues 196 196 pull requests 20 20 actions security and quality 8 8 insights more items testbed overridecomponent breaks module imports with angular build unit test 33064 new issue copy link new issue copy link open open testbed overridecomponent breaks module imports with angular build unit test 33064 copy link labels angular build unit test area angular build description m yst ery opened on apr 28 2026 issue body actions command test 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 reopening from angular angular 68363 as i don t feel it was fully answered and i later found the issue is related to the new builder when using the angular build unit test builder testbed overridecomponent breaks imports out of modules this happens for both vitest and karma runners so i would assume it is connected to the build not the test execution the issue does not occur when using other builder like angular devkit build angular karma minimal reproduction plain angular project packages needed for running karma app spec ts import component ngmodule from angular core import testbed from angular core testing component selector test component template export class testcomponent ngmodule imports testcomponent exports testcomponent export class testmodule component selector app root imports testmodule template test component test component export class app describe app beforeeach async await testbed configuretestingmodule imports app overridecomponent app problematic call compilecomponents it should create expect testbed createcomponent app tobetruthy angular json fails test vitest builder angular build unit test options runner vitest fails test karma builder angular build unit test options runner karma this one works test karma devkit builder angular devkit build angular karma options tsconfig tsconfig spec json running the test with angular build unit test it fails for both runners with error ng0304 test component is not a known element used in the _app component template 1 if test component is an angular component then verify that it is included in the component imports of this component 2 if test component is a web component then add custom_elements_schema to the component schemas of this component to suppress this message validateelementisknown darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions element_validation ts 116 14 validateelementisknown darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions element ts 151 4 initializeelement darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions element ts 127 2 ɵɵelementstart darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions element ts 218 2 _app_template ng _app js 6 21 templatefn darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions shared ts 109 4 executetemplate darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions render ts 107 6 renderview darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions render ts 47 4 rendercomponent darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions render ts 160 4 renderchildcomponents darwin_arm64 fastbuild st fdfa778d11ba bin packages core src render3 instructions render ts 140 6 with the angular devkit build angular karma it passes as expected also actually overriding something in testbed overridecomponent doesn t change the behaviour i originally discovered this with a test that needs to stub a component i left it out for simplicity here exception or error your environment _ _ ____ _ ___ _ __ __ _ _ _ __ _ _ __ ___ _ _ _ _ _ __ ___ _ _ _ ___ ___ _ _ _ _ __ __ _ _ __ _ _ ____ _____ ___ ___ angular cli 21 2 8 angular 21 2 10 node js 24 15 0 package manager npm 10 9 4 operating system win32 x64 package installed version requested version angular devkit build angular 21 2 8 21 2 8 angular build 21 2 8 21 2 7 angular cli 21 2 8 21 2 7 angular common 21 2 10 21 2 0 angular compiler 21 2 10 21 2 0 angular compiler cli 21 2 10 21 2 0 angular core 21 2 10 21 2 0 angular forms 21 2 10 21 2 0 angular platform browser 21 2 10 21 2 0 angular router 21 2 10 21 2 0 rxjs 7 8 2 7 8 0 typescript 5 9 3 5 9 2 vitest 4 1 5 4 0 8 anything else relevant no response react with 2 reacted by ben evans and john crim activity alan agius4 added area angular build angular build unit test on apr 28 2026 abercrave commented on may 29 2026 abercrave on may 29 2026 more actions confirming this happens at scale in a real world angular 21 codebase doing a jest vitest migration via angular build unit test and reinforcing the op s clarification that this is distinct from 48432 that s an older issue from angular 15 2022 under the legacy angular devkit build angular builder with a different trigger set imports vs empty and a different effect override silently ignored vs existing imports destroyed our independent reproduction matches the op s the bug only manifests under angular build unit test the legacy builder is unaffected 49 specs out of 1 225 4 in our codebase hit this exact pattern concentrated in detail form components where one shared ngmodule re exports standalone components used across a feature test only workarounds that don t work overridecomponent add imports thereexportedcomponent the sut template is aot pre compiled against the sut s original imports runtime overridecomponent modifications don t reach element resolution so the ng0304 still fires custom_elements_schema silences the error but leaves the element unrendered breaking any test that asserts on rendered output workaround that does work production code change remove the ngmodule from the sut s imports and replace with direct standalone component imports for the declarations the template actually uses move any module level providers from the ngmodule s providers to the sut s own component providers mechanical per sut verified on one sut in our codebase the ng0304 error is gone and the jest sibling continues to pass the sut change is purely additive happy to provide an isolated repro of either the failure or the workaround if it would help triage thanks for the original report the detail that an empty overridecomponent app triggers the bug saved us hours my environment _ _ ____ _ ___ _ __ __ _ _ _ __ _ _ __ ___ _ _ _ _ _ __ ___ _ _ _ ___ ___ _ _ _ _ __ __ _ _ __ _ _ ____ _____ ___ ___ angular cli 21 2 8 angular 21 2 9 node js 24 14 0 package manager npm 11 15 0 operating system darwin arm64 package installed version requested version angular devkit build angular 21 2 8 21 2 8 angular devkit core 21 2 8 21 2 8 angular animations 21 2 9 21 2 9 angular build 21 2 8 21 2 8 angular cdk 21 2 8 21 2 8 angular cli 21 2 8 21 2 8 angular common 21 2 9 21 2 9 angular compiler 21 2 9 21 2 9 angular compiler cli 21 2 9 21 2 9 angular core 21 2 9 21 2 9 angular forms 21 2 9 21 2 9 angular language service 21 2 9 21 2 9 angular platform browser 21 2 9 21 2 9 angular platform browser dynamic 21 2 9 21 2 9 angular router 21 2 9 21 2 9 angular service worker 21 2 9 21 2 9 rxjs 7 8 2 7 8 2 typescript 5 9 3 5 9 3 vitest 4 1 7 4 1 7 zone js 0 16 1 0 16 1 react with 1 reacted by john crim johncrim commented on jul 4 2026 johncrim on jul 4 2026 more actions we re affected by this in a big way it s making migrating to vitest the new builder much more work and much more verbose than it should be initially i thought it was a bug in testing library angular but while working on a repro case i found that it s a surprising bug in testbed common testing scenarios like overriding the test component template or adding updating imports of test component dependencies from modules are all broken i can provide more repro cases if it s helpful this is a severe bug that will add a bunch of frustration to anyone migrating to the new test builder johncrim commented on jul 5 2026 johncrim on jul 5 2026 last edited by johncrim more actions my take is that this bug is a bigger problem than the angular team perceives it to be i m guessing that google isn t using the new angular build unit test builder otherwise this would get more attention so i added some test cases to show what works doesn t work in a minimal repro repo https github com johncrim ng testbed compile bug key points bug is still present and behavior unchanged in ng 22 same behavior as ng 21 it is not specific to standalone components like testbed overridecomponent doesn t update standalone components angular 48432 these tests work as expected in the legacy devkit karma builder which is deprecated this bug should be counted as a regression assuming that the new unit test builder should support the same test code as the legacy builder these failures prevent easy migration to the new test builder of tests that use test helpers like testing library angular s render template string the presence of these bugs will likely add a lot of unnecessary work and frustration to teams migrating large numbers of tests to the new builder the error messages are misleading and cause of failure difficult to determine in my experience this bug also confuses ai agents results in a lot of cycles and trying things when using ai to migrate tests to vitest the new builder johncrim commented on jul 5 2026 johncrim on jul 5 2026 more actions i m pretty sure this compile failure is related to this bug though it may be separate this code block compiles and runs successfully in the devkit karma builder but fails to build with the unit test builder does not compile using angular build unit test builder so first test can t be run when running using unit test builder comment out this component and the first test component template div data testid test host test cmp1 div standalone false class testhostcomponent it creates host component with child component from module async const testbed testbed configuretestingmodule declarations testhostcomponent imports testmodule await testbed compilecomponents const fixture testbed createcomponent testhostcomponent await expectcontainstestcmp1 fixture the compile failure when using the unit test builder is application bundle generation failed 1 551 seconds 2026 07 05t20 41 34 238z x error ng8001 test cmp1 is not a known element 1 if test cmp1 is an angular component then verify that it is part of this module 2 if test cmp1 is a web component then add custom_elements_schema to the ngmodule schemas of this component to suppress this message plugin angular compiler src tests testbednotstandaloneoverrideimports spec ts 31 44 31 template div data testid test host test cmp1 div since it s a compile failure none of the tests run unless the block is commented out jeanmeche commented on jul 5 2026 jeanmeche on jul 5 2026 last edited by jeanmeche member more actions the core issue here is that the vite test runner builds unit tests with aot instead of jit which was what the karma runner was doing if you set test builder angular build karma options aot true you will get the same error the issues described here as closely related to angular angular 65665 johncrim commented on jul 6 2026 johncrim on jul 6 2026 last edited by johncrim more actions thanks for the comment jeanmeche i checked and verified that you re correct that the compile failure i m seeing with the unit test builder can be reproduced with the angular devkit build angular karma builder by adding aot true i find this kind of alarming since it s a valid test that just doesn t work when aot is enabled but reading the thread in angular 65665 does help clear things up for the compile error in short the aot compiler requires a separate ngmodule to discover the dependencies that can be used in the non standalone test component s template the testing module in configuretestingmodule can t be used as the module when aot is enabled conclusion i thought the compile error was a related or the same bug but it is separate and already covered by angular 65665 if i fix that and run the tests in the legacy devkit karma builder with aot true i get some overlapping and some different failures overriding a test component template succeeds in the legacy test builder and fails in the new one testbed configuretestingmodule imports testhostcomponent overridecomponent testhostcomponent set template test cmp1 test cmp1 per the description of this bug above calling overridecomponent breaks test component imports importing a standalone child component works in the new test builder and fails in the legacy one testbed configuretestingmodule imports standalonewrappercomponent overridecomponent standalonewrappercomponent set template test cmp1 imports testcmp1 which is good b c it s a critical workaround and importing test component dependencies via modules only works with jit compilation the legacy default and fails in the legacy builder with aot true and fails in the new builder testbed configuretestingmodule imports standalonewrappercomponent overridecomponent standalonewrappercomponent set template test cmp1 imports testmodule all of these cases can be examined and run in my https github com johncrim ng testbed compile bug test case repo i stand by my previous statement that these changes in behavior are a big deal for anyone migrating a large number of tests to the new test builder especially since the old builder is deprecated so teams trying to stay on the angular upgrade path are being pushed to migrate johncrim added a commit that references this issue on jul 6 2026 improve tests add support for running legacy karma builder with aot 6199e7a sign up for free to join this conversation on github already have an account sign in to comment metadata metadata assignees no one assigned labels angular build unit test area ...
|