Closed ellermister closed 4 weeks ago
Same problem here, and also when changed from .ts to .js fixed the error. I had this error several weeks ago, and still going
@ineshbose This might be due to the recent refactor you made in tailwind.ts
, would you have an idea?
Thanks for the ping @benjamincanac
changing .ts to .js fixes the issue
While the module uses loadConfig
from tailwindcss (that uses jiti), there shouldn't be ESM/CJS syntax issues, but if they exist because CJS syntax is used, it is best to specify .cjs extension.
It only reads tailwind.config.ts in the root directory
I think I know what is going on - https://github.com/nuxt/ui/blob/dev/src/tailwind.ts#L77
The defu
between nuxt/ui
's tailwind module config and user tailwind module config is a bit conflicting as configPath
is an array for the former and a string in the latter. You can put [] around your string in configPath
and see if this works, but I should also raise a PR for this condition.
Description
nuxt.config.ts
No matter what, it will only read
tailwind.config.ts
in the root directory. And the suffix cannot be .tspackage.json
Obviously, my package is configured
type:"module"
.So when the suffix is ​​.js/mjs, everything works fine.
So, is this normal? did I overlook something?
dependencies: