Skip to content

Conversation

@deining
Copy link
Contributor

@deining deining commented Nov 4, 2025

Currently, when creating a new changeset via command npx @changesets/cli, an error is thrown:

🦋 ...
🦋  === Summary of changesets ===
🦋  minor:  astro
🦋
🦋  Note: All dependents of these packages that will be incompatible with the new version will be patch bumped when this changeset is applied.
🦋
🦋  Is this your desired changeset? (Y/n) · true
🦋  error Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\xxx\GitHub\astro\prettier.config.js from C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js not supported.
🦋  error Instead change the require of prettier.config.js in C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js to a dynamic import() which is available in all CommonJS modules.
🦋  error     at module2.exports (C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js:83:61)
🦋  error     at loadJs2 (C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js:8050:22)
🦋  error     at Explorer.loadFileContent (C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js:8449:36)
🦋  error     at Explorer.createCosmiconfigResult (C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js:8453:40)
🦋  error     at Explorer.loadSearchPlace (C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js:8438:35)
🦋  error     at async Explorer.searchDirectory (C:\Users\xxx\AppData\Local\npm-cache\_npx\c21dc4ee7bbf9939\node_modules\prettier\third-party.js:8428:31) {
🦋  error   code: 'ERR_REQUIRE_ESM'
🦋  error }

This PR resolves that issue by renaming config file prettier.config.js to prettier.config.mjs.
This is in line with the README.md file of the Prettier Pugin for Astro which also suggest to use prettier.config.mjs as config file.

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2025

⚠️ No Changeset found

Latest commit: eeb8f4d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@florian-lefebvre
Copy link
Member

There's a link to the prettier config in STYLE_GUIDE.md, can you update it as well?

@deining deining force-pushed the fix-create-changeset branch from 52d81bf to eeb8f4d Compare November 7, 2025 14:12
@deining
Copy link
Contributor Author

deining commented Nov 7, 2025

There's a link to the prettier config in STYLE_GUIDE.md, can you update it as well?

Done, thanks for pointing that out!

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

Thanks!

@florian-lefebvre florian-lefebvre merged commit f91d97b into withastro:main Nov 7, 2025
22 of 23 checks passed
@deining deining deleted the fix-create-changeset branch November 7, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants