tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.75k stars 183 forks source link

Doesn't work with ES Module syntax #909

Closed AnzeKop closed 3 months ago

AnzeKop commented 4 months ago

What version of VS Code are you using? Latest

What version of Tailwind CSS IntelliSense are you using? Latest 0.10.5

What version of Tailwind CSS are you using? 3.3.2

What package manager are you using? Npm

What operating system are you using? Linux, macOS

Tailwind config import { fileURLToPath } from 'url'; const componentsDir = fileURLToPath(new URL('./components', import.meta.url));

export default { content: [${componentsDir}/**/*.{js,ts,jsx,tsx}], important: true, theme: { extend: {}, }, plugins: [], };

Describe your issue

[Error - 10:50:21 AM] Tailwind CSS: Cannot use 'import.meta' outside a module {directory}/tailwind.config.js:2 const componentsDir = _url.fileURLToPath.call(void 0, new URL('./components', import.meta.url)); ^^^^

SyntaxError: Cannot use 'import.meta' outside a module

Telling me that it doesn't support ES6 syntax. Converting the config to commonJS fixes this bug but the build pipeline forces me to use ES6.

thecrypticace commented 3 months ago

Hey, this is a problem in Tailwind CSS itself. We'll get a release out soon that addresses this.