Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require() of ES Module is not supported #592

Closed
muuvmuuv opened this issue Aug 9, 2022 · 2 comments
Closed

require() of ES Module is not supported #592

muuvmuuv opened this issue Aug 9, 2022 · 2 comments

Comments

@muuvmuuv
Copy link

muuvmuuv commented Aug 9, 2022

What version of Tailwind CSS IntelliSense are you using?

For example: v0.8.6

What version of Tailwind CSS are you using?

For example: v3.1.8

What package manager are you using?

pnpm

What operating system are you using?

macos

Reproduction URL

Set "type: module" in package.json and use export default {}

Describe your issue

I have switched to "type: module" in my Vite project due to latest Vite changes and ECMA consistency. Unfortunately the VS Code extension throws an error but compilation works fine. It seems some sort of import error happens.

@muuvmuuv
Copy link
Author

muuvmuuv commented Aug 9, 2022

This postcss config works btw:

import tailwind from "tailwindcss"
import autoprefixer from "autoprefixer"

import tailwindConfig from "./tailwind.config.js"

export default {
  plugins: [tailwind(tailwindConfig), autoprefixer],
}

@thecrypticace
Copy link
Contributor

This is happening because Tailwind CSS does not yet support ESM config files. We'll need to update Tailwind CSS itself, Intellisense, our prettier plugin, and other bits to support ESM. It's something we want to do but need to devote a proper amount of time to doing it for everything at one time. I gave a short explanation about this here: tailwindlabs/tailwindcss#3544 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants