René's URL Explorer Experiment


Title: @ngtools/webpack: `elideImports` keeps type-only specifiers that are re-exported or `extends`-ed, so webpack 5.112 (build-angular 21.2.28) fails the build · Issue #34580 · angular/angular-cli · GitHub

Open Graph Title: @ngtools/webpack: `elideImports` keeps type-only specifiers that are re-exported or `extends`-ed, so webpack 5.112 (build-angular 21.2.28) fails the build · Issue #34580 · angular/angular-cli

X Title: @ngtools/webpack: `elideImports` keeps type-only specifiers that are re-exported or `extends`-ed, so webpack 5.112 (build-angular 21.2.28) fails the build · Issue #34580 · angular/angular-cli

Description: Command build (also serve) Is this a regression? Yes. The previous version in which this bug was not present was 21.2.27 (webpack 5.105.2). Strictly speaking, 21.2.27 already emits the bad import too (see below). webpack 5.112 just makes...

Open Graph Description: Command build (also serve) Is this a regression? Yes. The previous version in which this bug was not present was 21.2.27 (webpack 5.105.2). Strictly speaking, 21.2.27 already emits the bad import t...

X Description: Command build (also serve) Is this a regression? Yes. The previous version in which this bug was not present was 21.2.27 (webpack 5.105.2). Strictly speaking, 21.2.27 already emits the bad import t...

Opengraph URL: https://github.com/angular/angular-cli/issues/34580

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@ngtools/webpack: `elideImports` keeps type-only specifiers that are re-exported or `extends`-ed, so webpack 5.112 (build-angular 21.2.28) fails the build","articleBody":"### Command\n\nbuild (also serve)\n\n### Is this a regression?\n\nYes. The previous version in which this bug was not present was **21.2.27** (webpack 5.105.2). Strictly speaking, 21.2.27 already emits the bad import too (see below). webpack 5.112 just makes it an error.\n\n### Description\n\nWith `@angular-devkit/build-angular:browser` 21.2.28 (which updated webpack to 5.112.0), an AOT build fails with:\n\n```\n./src/app/data.service.ts:1:0-33 - Error: export 'Status' (imported as 'Status') was not found in './types' (module has no exports)\n```\n\n`Status` is an interface. The failure needs all three of these in one file:\n\n1. The file has a decorated class, so `removeIvyJitSupportCalls` removes its `ɵsetClassMetadata` call and runs `elideImports`.\n2. One `import { ... }` statement brings in several interfaces.\n3. Some of those interfaces are used only in type annotations, and at least one is either re-exported (`export type { Status }`) or used in an interface `extends Status`.\n\nWhat happens:\n\n- `elideImports` drops the annotation-only specifiers. Its visitor skips `TypeReferenceNode`s.\n- It keeps the others as \"used\". It records `ExportSpecifier`s without checking for `export type`, and it only skips `implements` heritage clauses, so an interface's `extends` counts as a use.\n- That rewrites the `ImportDeclaration`. TypeScript then skips its own import elision for that statement, because `isElisionBlocked` is true when a `before` transformer has replaced the node.\n- So `import { Status } from './types'` survives into the emitted JS, although `Status` has no runtime value.\n\nWith webpack 5.105 this was a silent dead import. The repro's dev build on 21.2.27 still contains `__webpack_require__(/*! ./types */ ...)` in `data.service`'s module.\n\nwebpack 5.112 now link-checks import specifiers even when they are never read, and Angular's `strictExportPresence: true` makes that an error.\n\nControls (each of these builds cleanly on 21.2.28):\n\n- `import type { Item, Status }`\n- no `export type { Status }`, so both names are annotation-only and the whole import is removed\n- `import { Status }` on its own line plus `export type { Status }`, so nothing in that statement is partially removed and TypeScript elides it as usual\n- the same file without the `@Injectable` decorator, so `elideImports` never runs\n\nA possible fix is for `elideImports` to count a symbol as used only when its alias target has a value meaning (`SymbolFlags.Value`). Narrower alternatives: skip `export type` declarations and specifiers, and skip interface heritage clauses.\n\n### Minimal Reproduction\n\nSeven files. `npm install`, then `npx ng build` (or `npx ng build -c development`).\n\n`package.json`\n```json\n{\n  \"name\": \"ngtools-webpack-type-reexport-repro\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@angular/common\": \"21.2.25\",\n    \"@angular/compiler\": \"21.2.25\",\n    \"@angular/core\": \"21.2.25\",\n    \"@angular/platform-browser\": \"21.2.25\",\n    \"rxjs\": \"7.8.2\",\n    \"tslib\": \"2.8.1\"\n  },\n  \"devDependencies\": {\n    \"@angular-devkit/build-angular\": \"21.2.28\",\n    \"@angular/cli\": \"21.2.28\",\n    \"@angular/compiler-cli\": \"21.2.25\",\n    \"typescript\": \"5.9.3\"\n  }\n}\n```\n\n`angular.json`\n```json\n{\n  \"version\": 1,\n  \"projects\": {\n    \"repro\": {\n      \"projectType\": \"application\",\n      \"root\": \"\",\n      \"sourceRoot\": \"src\",\n      \"architect\": {\n        \"build\": {\n          \"builder\": \"@angular-devkit/build-angular:browser\",\n          \"options\": {\n            \"outputPath\": \"dist/repro\",\n            \"index\": \"src/index.html\",\n            \"main\": \"src/main.ts\",\n            \"tsConfig\": \"tsconfig.json\"\n          },\n          \"configurations\": {\n            \"production\": { \"optimization\": true, \"outputHashing\": \"all\" },\n            \"development\": { \"optimization\": false, \"sourceMap\": true }\n          },\n          \"defaultConfiguration\": \"production\"\n        }\n      }\n    }\n  }\n}\n```\n\n`tsconfig.json`\n```json\n{\n  \"compilerOptions\": {\n    \"strict\": true,\n    \"target\": \"ES2022\",\n    \"module\": \"ES2022\",\n    \"moduleResolution\": \"bundler\",\n    \"lib\": [\"ES2022\", \"dom\"],\n    \"skipLibCheck\": true\n  },\n  \"files\": [\"src/main.ts\"]\n}\n```\n\n`src/index.html`\n```html\n\u003c!doctype html>\n\u003chtml>\u003chead>\u003cmeta charset=\"utf-8\">\u003ctitle>repro\u003c/title>\u003c/head>\u003cbody>\u003capp-root>\u003c/app-root>\u003c/body>\u003c/html>\n```\n\n`src/main.ts`\n```ts\nimport { bootstrapApplication } from '@angular/platform-browser';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent).catch(err => console.error(err));\n```\n\n`src/app/app.component.ts`\n```ts\nimport { Component, inject } from '@angular/core';\nimport { DataService } from './data.service';\n\n@Component({ selector: 'app-root', template: '{{ id }}' })\nexport class AppComponent {\n  id = inject(DataService).first().id;\n}\n```\n\n`src/app/types.ts`\n```ts\nexport interface Item {\n  id: number;\n}\n\nexport interface Status {\n  done: boolean;\n}\n```\n\n`src/app/data.service.ts`\n```ts\nimport { Injectable } from '@angular/core';\nimport { Item, Status } from './types';\n\n// Re-export a type for consumers of this service.\nexport type { Status };\n\n@Injectable({ providedIn: 'root' })\nexport class DataService {\n  first(): Item {\n    return { id: 1 };\n  }\n}\n```\n\nThe `extends` variant fails the same way. Replace the `export type { Status };` line with:\n\n```ts\nexport interface DetailedStatus extends Status {\n  note: string;\n}\n```\n\n### Exception or Error\n\n```\n./src/app/data.service.ts:1:0-33 - Error: export 'Status' (imported as 'Status') was not found in './types' (module has no exports)\n```\n\n### Your Environment\n\n```\nAngular CLI       : 21.2.28\nAngular           : 21.2.25\nNode.js           : 20.20.2\nPackage Manager   : npm 10.8.2\nOperating System  : darwin arm64\n\n@angular-devkit/build-angular  21.2.28\n@angular/cli                   21.2.28\n@angular/common                21.2.25\n@angular/compiler              21.2.25\n@angular/compiler-cli          21.2.25\n@angular/core                  21.2.25\n@angular/platform-browser      21.2.25\nrxjs                           7.8.2\ntypescript                     5.9.3\nwebpack                        5.112.0\n```\n\nAlso reproduced on Node 22.23.2 (node:22-alpine) in the real app.\n\n### Anything else relevant?\n\n- We hit this in a production app when moving from build-angular 21.2.26 to 21.2.28. 7 interface names in 3 files failed, and both `ng build` and `ng serve` broke.\n- Workaround: `import type`.\n- Neither TypeScript guard catches it. `isolatedModules` doesn't flag the pattern, and `verbatimModuleSyntax` flags every type import in a large codebase.\n- `ngc` alone emits these files correctly. Only the `@ngtools/webpack` pipeline leaves the specifier behind.\n- The `@angular/build` (esbuild) builders are not affected, as far as we can tell.\n","author":{"url":"https://github.com/ohItzYosh","@type":"Person","name":"ohItzYosh"},"datePublished":"2026-10-29T06:41:04Z","url":"https://github.com/angular/angular-cli/issues/34580"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:76461f09-bbd3-5b86-d5c9-3417c36e04f7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE4C0:3F8AB1:3B2A4F4:4B29C89:6B01E848
html-safe-nonce4740b2ed9da56f1dbf012c83ef790632ea5890cccbeb9a7443dea4b333a8e4b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEMwOjNGOEFCMTozQjJBNEY0OjRCMjlDODk6NkIwMUU4NDgiLCJ2aXNpdG9yX2lkIjoiNjQyNTUyNjE2NzYwMzg5ODQ0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccd66f1d5916b9ea0455e3b7f63efec0dea9912d2e6a0227afe7723ced5a05360
hovercard-subject-tagissue:6094423486
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34580/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6d3da24a792ce92ced3d1a91b0e15e1f7176e2c8011faad1605f7e50d249efcd/angular/angular-cli/issues/34580
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6d3da24a792ce92ced3d1a91b0e15e1f7176e2c8011faad1605f7e50d249efcd/angular/angular-cli/issues/34580
og:image:altCommand build (also serve) Is this a regression? Yes. The previous version in which this bug was not present was 21.2.27 (webpack 5.105.2). Strictly speaking, 21.2.27 already emits the bad import t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameohItzYosh
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/34580#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F34580
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F34580
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/34580
Reloadhttps://github.com/angular/angular-cli/issues/34580
Reloadhttps://github.com/angular/angular-cli/issues/34580
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34580
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34580
#34582https://github.com/angular/angular-cli/pull/34582
@ngtools/webpack: elideImports keeps type-only specifiers that are re-exported or extends-ed, so webpack 5.112 (build-angular 21.2.28) fails the buildhttps://github.com/angular/angular-cli/issues/34580#top
#34582https://github.com/angular/angular-cli/pull/34582
area: @ngtools/webpackhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40ngtools%2Fwebpack%22
needsTriagehttps://github.com/angular/angular-cli/milestone/11
https://github.com/ohItzYosh
ohItzYoshhttps://github.com/ohItzYosh
on Oct 29, 2026https://github.com/angular/angular-cli/issues/34580#issue-6094423486
angular-robothttps://github.com/apps/angular-robot
area: @ngtools/webpackhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40ngtools%2Fwebpack%22
on Oct 29, 2026https://github.com/angular/angular-cli/issues/34580#event-34555579661
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on Oct 29, 2026https://github.com/angular/angular-cli/issues/34580#event-34555581288
alan-agius4https://github.com/alan-agius4
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#34582https://github.com/angular/angular-cli/pull/34582
on Oct 29, 2026https://github.com/angular/angular-cli/issues/34580#event-34598188134
alan-agius4https://github.com/alan-agius4
on Oct 29, 2026https://github.com/angular/angular-cli/issues/34580#event-34598198769
fix(@ngtools/webpack): elide imports used only in type re-exports or …https://github.com/angular/angular-cli/commit/4b6caacbc7028dfb70df64eb234f7909b6896079
https://docs.github.com/articles/closing-issues-via-commit-messages
4b6caachttps://github.com/angular/angular-cli/commit/4b6caacbc7028dfb70df64eb234f7909b6896079
angular-robothttps://github.com/angular-robot
on Oct 29, 2026https://github.com/angular/angular-cli/issues/34580#event-34598462860
fix(@ngtools/webpack): elide imports used only in type re-exports or …https://github.com/angular-robot/angular-cli/commit/b6bfa2c7476cf0fd939df2152491a5c694ff56bb
https://docs.github.com/articles/closing-issues-via-commit-messages
b6bfa2chttps://github.com/angular-robot/angular-cli/commit/b6bfa2c7476cf0fd939df2152491a5c694ff56bb
pipiche38https://github.com/pipiche38
on Nov 6, 2026https://github.com/angular/angular-cli/issues/34580#event-35353917312
Clear the open Dependabot alerts without leaving Angular 21https://github.com/pipiche38/Domoticz-Zigbee-UI/commit/607b761b349723cb360993bca777d09c27b598d9
607b761https://github.com/pipiche38/Domoticz-Zigbee-UI/commit/607b761b349723cb360993bca777d09c27b598d9
dgp1130https://github.com/dgp1130
on Nov 6, 2026https://github.com/angular/angular-cli/issues/34580#event-35396920306
fix(@ngtools/webpack): elide imports used only in type re-exports or …https://github.com/angular/angular-cli/commit/c2e64e9abe0b0191396cf28e5c6b452c5752a70a
https://docs.github.com/articles/closing-issues-via-commit-messages
c2e64e9https://github.com/angular/angular-cli/commit/c2e64e9abe0b0191396cf28e5c6b452c5752a70a
fix(@ngtools/webpack): elide imports used only in type re-exports or …https://github.com/angular/angular-cli/commit/4d75851e051490709b108eea8c15566269ec076e
https://docs.github.com/articles/closing-issues-via-commit-messages
4d75851https://github.com/angular/angular-cli/commit/4d75851e051490709b108eea8c15566269ec076e
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/34580
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34580
area: @ngtools/webpackhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40ngtools%2Fwebpack%22
needsTriageNo due datehttps://github.com/angular/angular-cli/milestone/11
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.