Closed Tawpie closed 1 week ago
Works on my machine. Could you please post an isolated reproduction where I can reproduce your issues?
I had this same error just now after setting up Storybook on my Nextjs project.
Reverting to ^0.1.3 stops the error from happening.
on my Nextjs project
@markof94 prove it! 🙂 (please)
on my Nextjs project
@markof94 prove it! 🙂 (please)
Hey, I managed to recreate it on a blank Next project. I copied over the packages from my original project's package.json and the same prettier and eslint configs. Here's the repo. Hope it helps!
Super, thanks - I can repro with that! Much appreciated!
The root issue is roughly what Prettier is hinting: that node_modules/prettier-plugin-curly/lib/index.js
has ESM import
s and export
s, but the project around it is not type: "module"
.
In other words, roughly https://github.com/JoshuaKGoldberg/create-typescript-app/blob/0a4c50f93c690af12356a9c99a7079ecb6da3a6f/docs/FAQs.md#how-can-i-add-dual-commonjs--ecmascript-modules-emit is needed. I'll do that real quick now. Thanks all!
@all-contributors please add @tawpie for bug.
🤖 Beep boop! This comment was added automatically by all-contributors-auto-action. Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed. ...and of course, thank you for contributing! 💙
@JoshuaKGoldberg
I've put up a pull request to add @tawpie! :tada:
I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.
👋 this should be fixed in prettier-plugin-curly@0.2.2
. Please let me know if you have a reproduction of it still being broken. Thanks again everyone!
Bug Report Checklist
main
branch of the repository.Expected
Plugin should run without error
Actual
Error [ERR_REQUIRE_ESM]: require() of ES Module [redacted]/node_modules/prettier-plugin-curly/lib/index.js from [redacted]/node_modules/prettier/index.js not supported. Instead change the require of [redacted]/node_modules/prettier-plugin-curly/lib/index.js in [redacted]/node_modules/prettier/index.js to a dynamic import() which is available in all CommonJS modules. at c._load (node:electron/js2c/node_init:2:13672)
Additional Info
happens with node 18.18.0 and 20.15.0