René's URL Explorer Experiment


Title: `NG_BUILD_OPTIMIZE_CHUNKS` can cause variable name collisions · Issue #32764 · angular/angular-cli · GitHub

Open Graph Title: `NG_BUILD_OPTIMIZE_CHUNKS` can cause variable name collisions · Issue #32764 · angular/angular-cli

X Title: `NG_BUILD_OPTIMIZE_CHUNKS` can cause variable name collisions · Issue #32764 · angular/angular-cli

Description: Command build 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 Yes NG_BUILD_OPTIMIZE_CHUNKS is still experimental. This is ju...

Open Graph Description: Command build 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 Yes NG_BUILD_OPTIMIZE_...

X Description: Command build 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 Yes NG_BUILD_OPTIMIZE_...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`NG_BUILD_OPTIMIZE_CHUNKS` can cause variable name collisions","articleBody":"### Command\n\nbuild\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nYes `NG_BUILD_OPTIMIZE_CHUNKS` is still experimental. This is just a bug I came across while testing it for #27715. I hit a rather nasty edge case with it on where two variable names ended up colliding inside main.js, one from a core Angular package, and the other being one of my components. Thankfully it broke the runtime early on cause otherwise I never would've caught it.\n\nThe mangled variable name that got hit was `Wb`. The first occurrence appears to be from https://github.com/angular/angular/blob/17d8a88ddcce3f850b8ab72252e05720e1f3a8be/packages/core/src/render3/definition.ts#L398-L436\n```js\nfunction Wb(e){return ro$3(()=\u003e({type:e.type,bootstrap:e.bootstrap||ce$4,declarations:e.declarations||ce$4,imports:e.imports||ce$4,exports:e.exports||ce$4,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}\n```\nThe second occurrence comes from one of my components (snippet under reproduction)\n```js\nvar Wb=[`open`,`opening`,`toggle`],Fi=class o{constructor(e,t){this._document=e;this._elementRef=t;let r=Wb.map(i=\u003e$U(ea(this._document,i,{capture:!0,passive:!0}).pipe(Pe$11(s=\u003es.target instanceof Element\u0026\u0026s.target!==this._elementRef.nativeElement\u0026\u0026!s.target.tagName.toLowerCase().startsWith(`md-menu`)))));\n```\n`Wb` breaks upon calling it on the third occurrence \u003cins\u003ein the same line as the previous\u003c/ins\u003e (which I assume means the same chunk), which appears to be from https://github.com/angular/components/blob/main/src/cdk-experimental/scrolling/scrolling-module.ts\n```js\nstatic ɵdir=Qb({type:o,selectors:[[`cdk-virtual-scroll-viewport`,`autosize`,``]],inputs:{minBufferPx:`minBufferPx`,maxBufferPx:`maxBufferPx`},features:[mw([{provide:bi$1,useFactory:D_,deps:[ci$5(()=\u003eo)]}]),TI]})}return o})(),Jh=(()=\u003e{class o{static ɵfac=function(r){return new(r||o)};static ɵmod=Wb({type:o});\n```\n\n### Minimal Reproduction\n\nThe mangled names appear to follow a deterministic sequence so you just have to hit it with enough variable declarations and some luck. Best I can offer is the component that got hit:\n```ts\nimport {\n  ChangeDetectionStrategy,\n  Component,\n  DOCUMENT,\n  ElementRef,\n  Inject,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { filter, fromEvent } from 'rxjs';\n\nconst POPOVER_EVENTS = ['open', 'opening', 'toggle'];\n\n@Component({\n  selector: 'md-menu',\n  styleUrl: './menu.component.scss',\n  templateUrl: './menu.component.html',\n})\nexport class MenuComponent {\n  constructor(\n    @Inject(DOCUMENT) private readonly _document: Document,\n    private readonly _elementRef: ElementRef\u003cHTMLElement\u003e,\n  ) {\n    const signals = POPOVER_EVENTS.map((name) =\u003e\n      toSignal(\n        fromEvent(this._document, name, { capture: true, passive: true }).pipe(\n          filter(\n            (value) =\u003e\n              value.target instanceof Element \u0026\u0026\n              value.target !== this._elementRef.nativeElement \u0026\u0026\n              !value.target.tagName.toLowerCase().startsWith('md-menu'),\n          ),\n        ),\n      ),\n    );\n  }\n}\n\n```\n\n### Exception or Error\n\n```text\nUncaught TypeError: Wb is not a function\n    at \u003cstatic_initializer\u003e (main-3IQSYYTY.js:1066:5353)\n    at main-3IQSYYTY.js:1066:5278\n    at main-3IQSYYTY.js:1066:5399\n    at main-3IQSYYTY.js:1:101\n    at main-3IQSYYTY.js:1068:36238\n```\n\n### Your Environment\n\n```text\nAngular CLI       : 21.2.2\nAngular           : 21.1.5\nNode.js           : 24.14.0\nPackage Manager   : pnpm 10.32.1\nOperating System  : win32 x64\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/austinw-fineart","@type":"Person","name":"austinw-fineart"},"datePublished":"2026-03-13T09:42:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/32764/angular-cli/issues/32764"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bb294aaf-69ab-0ace-e71b-3dc7d928d905
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB294:1A5583:35A0EC:48285B:6A629345
html-safe-nonce2e0e0ecd28ecfbab49e8c314bc0e79c59dd549783bc5fa2d7bffabe119b8ee6c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjk0OjFBNTU4MzozNUEwRUM6NDgyODVCOjZBNjI5MzQ1IiwidmlzaXRvcl9pZCI6IjI4MjE1NzkzNDY3MTI2MzAwODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacaea000af77cfdb8fc39c15da5366abbd521306780008b1f154dba9003945e64a
hovercard-subject-tagissue:4070024531
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/32764/issue_layout
twitter:imagehttps://opengraph.githubassets.com/15c4518614598cf71e746c4e5ce1bb5f89545a3f413d5971f37b8382efe0f443/angular/angular-cli/issues/32764
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/15c4518614598cf71e746c4e5ce1bb5f89545a3f413d5971f37b8382efe0f443/angular/angular-cli/issues/32764
og:image:altCommand build 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 Yes NG_BUILD_OPTIMIZE_...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaustinw-fineart
hostnamegithub.com
expected-hostnamegithub.com
None10ffaff7e212112a3b4eeb224665f909dff951514db9af4f00de33b681024427
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
releasee470e2fc66e1ac7f528caec0fd8825047788d563
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/32764#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F32764
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F32764
Sign up https://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/32764
Reloadhttps://github.com/angular/angular-cli/issues/32764
Reloadhttps://github.com/angular/angular-cli/issues/32764
Please reload this pagehttps://github.com/angular/angular-cli/issues/32764
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 269 https://github.com/angular/angular-cli/issues
Pull requests 29 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality 5 https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
NG_BUILD_OPTIMIZE_CHUNKS can cause variable name collisionshttps://github.com/angular/angular-cli/issues/32764#top
needs: repro stepsWe cannot reproduce the issue with the information givenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22needs%3A%20repro%20steps%22
https://github.com/austinw-fineart
austinw-finearthttps://github.com/austinw-fineart
on Mar 13, 2026https://github.com/angular/angular-cli/issues/32764#issue-4070024531
#27715https://github.com/angular/angular-cli/issues/27715
https://github.com/angular/angular/blob/17d8a88ddcce3f850b8ab72252e05720e1f3a8be/packages/core/src/render3/definition.ts#L398-L436https://github.com/angular/angular/blob/17d8a88ddcce3f850b8ab72252e05720e1f3a8be/packages/core/src/render3/definition.ts#L398-L436
https://github.com/angular/components/blob/main/src/cdk-experimental/scrolling/scrolling-module.tshttps://github.com/angular/components/blob/main/src/cdk-experimental/scrolling/scrolling-module.ts
needs: repro stepsWe cannot reproduce the issue with the information givenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22needs%3A%20repro%20steps%22
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.