UnoCSS installation issue related to ESM imports
Hi. I just started a brand new solid project and then added UnoCSS. But does not seem to work, it gives the following error:
Downgrading unocss to 0.58.9 fix the issue. Maybe it is something related to the breaking changes in https://github.com/unocss/unocss/releases/tag/v0.59.0 ?
GitHub
Release v0.59.0 · unocss/unocss
🚨 Breaking Changes
Move to ESM-only and fix package exports - by @kwaa, @userquin, @antfu, Chris and Anthony Fu in #3380 (41bc8)
preset-mini: RingWidth default changed to 3px to align with Ta...
2 Replies
I also am not sure if it is something on solid side or unocss side.
It's a vite thing.
Change
vite.config.ts
to vite.config.mts
Alternately add "type":"module",
to your package.json
"type"
Node version also plays into it, you should at least have v18 (I'm running v20).