Skip to content

Fix generate-assets script#765

Merged
constanzauanini merged 1 commit into
mainfrom
constanza/fix-generate-assets
May 28, 2026
Merged

Fix generate-assets script#765
constanzauanini merged 1 commit into
mainfrom
constanza/fix-generate-assets

Conversation

@constanzauanini

Copy link
Copy Markdown
Contributor
  • PR Upgrade prettier version to match terraware-web #735 bumped @trivago/prettier-plugin-sort-imports from v4 (CJS) to v6 (ESM with top-level await).
  • Prettier 2 (used by @svgr/plugin-prettier@8) loads plugins via require(), which on Node 20.19+ throws ERR_REQUIRE_ASYNC_MODULE when asked to require an ESM module with top-level await — so svgr crashes before producing any output

.svgrrc.cjs configures svgr to:

  • runtimeConfig: false — stops svgr's prettier from auto-discovering the repo's .prettierrc. That file declares the trivago plugin in its "plugins" field, so any prettier instance that reads it will then try to require() the plugin (which is the call that crashes inside svgr's bundled prettier 2)
  • prettierConfig: {...} — supply the same formatting options inline so generated files keep the project's single-quote
    style.

@constanzauanini constanzauanini requested a review from a team as a code owner May 27, 2026 15:25
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-components Ready Ready Preview, Comment May 27, 2026 3:25pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

To increment version on merge, please add one of patch (default), minor, or major label to this PR.

@github-actions github-actions Bot added the patch label May 27, 2026

@ice1080 ice1080 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bummer that these svg components won't follow the rest of the prettier config for the newline after imports, but obviously not a big deal

@constanzauanini constanzauanini merged commit f9acc31 into main May 28, 2026
6 checks passed
@constanzauanini constanzauanini deleted the constanza/fix-generate-assets branch May 28, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants