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

Extension does not work if you change the tailwind.config.js #700

Closed
whitespacecode opened this issue Jan 19, 2023 · 1 comment
Closed

Comments

@whitespacecode
Copy link

What version of Tailwind CSS IntelliSense are you using?
v0.9.6

What version of Tailwind CSS are you using?
v3.2.4

What package manager are you using?
npm

What operating system are you using?
macOS

Tailwind config

//The import or final build will not work with module.export
//module.exports = {
export default {
    content: [
        './resources/scripts/**/*.{vue,js,ts,jsx,tsx}',
    ],
    theme: {
        extend: {
        }, 
    },
};

Describe your issue
We changed our tailwind.config.js so it can be used as import in vue files

import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfig from 'tailwind.config.js';

const fullConfig = resolveConfig(tailwindConfig)

When using the intellisense plugin it fails on build
Error:
Tailwind CSS: Unexpected token 'export'

    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1086:15)
    at Module._compile (node:internal/modules/cjs/loader:1121:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
    at Module.load (node:internal/modules/cjs/loader:1035:32)
    at Module._load (node:internal/modules/cjs/loader:876:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1059:19)
    at LI._require.zs.default.require (/Users/joeriverstraete/.vscode/extensions/bradlc.vscode-tailwindcss-0.9.6/dist/tailwindServer.js:178:45213)
    at require (node:internal/modules/cjs/helpers:102:18)```
@bradlc
Copy link
Contributor

bradlc commented Jan 19, 2023

Hey @JoeriTheGreat. I'm going to close this as a duplicate of #565/#592

It's hard to say for certain without seeing your project, but you may be able to rename your config file to tailwind.config.cjs and revert back to module.exports to fix the issue 👍

@bradlc bradlc closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2023
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