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

Doesn't work with ES Module syntax #909

Closed
AnzeKop opened this issue Feb 17, 2024 · 1 comment · Fixed by tailwindlabs/tailwindcss#13322
Closed

Doesn't work with ES Module syntax #909

AnzeKop opened this issue Feb 17, 2024 · 1 comment · Fixed by tailwindlabs/tailwindcss#13322

Comments

@AnzeKop
Copy link

AnzeKop commented Feb 17, 2024

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
Copy link
Contributor

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

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

Successfully merging a pull request may close this issue.

2 participants