solid-jsx not working
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/sid/my-app/node_modules/@mdx-js/rollup/index.js from /ho
me/sid/my-app/vite.config.js not supported.
![](https://utfs.io/f/446e34ff-dd29-421e-9618-b14a01beb3bf-1nq2cb.png)
150 Replies
@.high1 any idea?
my vite config
![](https://utfs.io/f/0286cbcc-3065-4391-ab76-2a9eb3ed3f5e-1nq2cb.png)
Have you got
"type": "module"
in your package.json
?oh cool the error is gone now!
Feel free to close this thread if your query is resolved. Perhaps open another one if you have a different question.
Thanks, @brendan_csel . There's a section dedicated to this in the beginning of the README file,
Use mdx or xdm with solid-js.
This module is ESM only, due to mdx and xdm being ESM only.
Adding
"type": "module"
in package.json is one option.
i tried this but i get some postcss error now
![](https://utfs.io/f/af383bcd-ca0e-44f5-a1e0-caae94428c91-1nq2cb.png)
Well, if your project is a module, you need to be explicit
it's postcss.config.cjs if you are writing common JS
Or use a more modern syntax and postcss.config.js or mjs
i renamed the file and i get this error now
![](https://utfs.io/f/c60cff6f-b351-40fb-8012-a9d4c8c149cd-1nq2cb.png)
It's the same issue.
You really need to read ๐ these error messages.
Just name it tailwind.config.cjs
If something uses
module.exports...
, it's cjsoh
i changed the syntax for both the files but i get the same error!
You can use export default for tailwind and postcss, if you prefer that
What did you do exactly?
![](https://utfs.io/f/456cb508-9550-4ac4-a653-83a593938c87-1nq2cb.png)