kidonng / unocss-preset-daisy

UnoCSS preset for daisyUI
https://unocss-preset-daisy.vercel.app
MIT License
220 stars 19 forks source link

Getting error "Must use import to load ES Module" #7

Closed subhasish-smiles closed 1 year ago

subhasish-smiles commented 1 year ago

Getting this error while trying it with solid js, vite and unocss.

[ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/hp/myWorkspace/solid-capacitor/client/node_modules/unocss-preset-daisy/index.js
require() of ES modules is not supported.
Dustella commented 1 year ago

Since node will not run esm directly, you should add "type": "module" in your package.json.

kidonng commented 1 year ago

Please try the latest version if you are still encountering issues.

This is a good read on (pure) ESM package: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c