fix(design-system): don't break icons if process is not defined - #3525
Merged
Merged
Conversation
JammingBen
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Many live code examples in the design system docs were not rendered. The browser console showed
ReferenceError: process is not defined.addVersionToAssetUrl()readsprocess.env.PACKAGE_VERSIONto add a cache-busting parameter to icon URLs (introduced in #3082). The value is only injected viadefinein the rootvite.config.ts. The VitePress config of the docs doesn't inject it, soprocessdoesn't exist in the browser there. As a result, everyOcIconthrew during rendering and Vue dropped the whole example. This affected every example that renders an icon somewhere (23 of 51 component pages, e.g. OcButton, OcSelect, OcPagination, OcTextInput).process.env.PACKAGE_VERSIONaccess is wrapped intry/catchand falls back toundefinedtypeof processcheck is deliberately not useddefineonly replaces theprocess.env.PACKAGE_VERSIONexpression, sotypeof processwould beundefinedin the web build and break the cache bustingassets.spec.tsprocesscaseRelated Issue
How Has This Been Tested?
pnpm docs:dev), production build served by the local OpenCloud backend on port 9200, Chromeprocess is not definedwithout itpnpm build, checked that the bundle still contains the injected version (try{return`8.0.0`}) and that all icon requests on 9200 still have?v=8.0.0in their URLsassets.spec.ts, the missingprocesscase fails without the fixTypes of changes