windicss-intellisense
windicss-intellisense copied to clipboard
Error loading config with `Auto Rename Tag` installed
Problem: extension cant load the config file and thus doesn't work at all. If I use version 0.11.7 this error doesn't occur. Only happens if I upgrade.
Extension version: 0.15.1 Extension initial output:
⚠ WARN: SyntaxError: Unexpected token � in JSON at position 0
Windi CSS Intellisense is now active!
Output after I modify the config file (windi.config.ts)
⚠ WARN: SyntaxError: Unexpected token � in JSON at position 0
Windi CSS Intellisense is now active!
⚠ WARN: TypeError: Cannot read property 'visitors' of undefined
⚠ WARN: SyntaxError: Unexpected token � in JSON at position 0
⚠ WARN: Error: undefined: Must export a default export when using ES6 modules.
e:\Projects\Collaborations\vocal-web-app\windi.config.ts:0:0
Config file: (windi.config.ts)
import { defineConfig } from 'windicss/helpers';
export default defineConfig({
darkMode: false,
theme: {
fontFamily: {
sans: ['Inter', 'Roboto', 'sans-serif']
},
extend: {
colors: {
accent: '#6366f1'
},
textColor: {
default: '#202020',
'default-light': '#454545',
inverse: '#fff'
},
backgroundColor: {
default: '#f8f6f5',
'default-elevated': '#fff',
inverse: '#000'
}
}
},
});
I can't reproduce it. Using your attached config file, gives no errors for me.
I can reproduce it on my eggsy/website repository. My config is below, I don't think there are any problems with it because it works, I just don't get autocompletion and all (I get class sorting though).
import { defineConfig } from "windicss/helpers"
import defaultTheme from "windicss/defaultTheme"
import lineClamp from "windicss/plugin/line-clamp"
export default defineConfig({
darkMode: "class",
theme: {
fontFamily: {
sans: ["Inter", ...defaultTheme.fontFamily.sans],
},
},
plugins: [lineClamp],
})
Here are the errors I get when I save this exact same config file.
My extension's version is 0.16.2.
@eggsy I use latest VS Code Insider. I just copied the config in windi.config.ts
. And it works for me. Can you please open an simple html project folder and paste the windi.config.ts
file in there. I want to make sure it is happening there too.
@eggsy I use latest VS Code Insider. I just copied the config in
windi.config.ts
. And it works for me. Can you please open an simple html project folder and paste thewindi.config.ts
file in there. I want to make sure it is happening there too.
Yep, it's still the same, I tried upgrading my dependencies, upgrading typescript
and re-installing the VSC Extension, nothing seems to work.
/cc @voorjaar can you reproduce it? I can not reproduce it
Extension works (autocomplete, etc.) if I remove the config file.
Hmm yeah. So somehow there is a bug, don't know the cause yet
/cc @voorjaar can you reproduce it? I can not reproduce it
I can't either, not sure what happened here.
Huh? This is weird but it just started working. I don't know if it started working after the last release but I think I've tried it, didn't work. Somehow it works now. I didn't change anything in the config, I also didn't do anything to fix it. I just tried to clone and console.log
the JSON.parse
then saw there were no errors 😅. It's working now!
Let's keep an eye on this for a while
I think I may have found the cause (for me at least). It was the extension Auto Rename Tag by Jun Han
. I found lines in prettier output that said it couldn't load and parse a JSON in that extension's folder. I disabled it and the WindiCSS extension started to work.
@eggsy do you also use this extension (Auto Rename Tag)?
Huh? This is weird but it just started working. I don't know if it started working after the last release but I think I've tried it, didn't work. Somehow it works now. I didn't change anything in the config, I also didn't do anything to fix it. I just tried to clone and
console.log
theJSON.parse
then saw there were no errors 😅. It's working now!
It's weird, I didn't fix this either...
Can confirm, once I deactivated the Auto Rename Tag by Jun Han
it worked for me again.
https://github.com/windicss/windicss-intellisense/issues/113 has also an issue with Auto Rename Tag.. I am not sure what's going on. But it seems that Extension does change the behavior of our extension a lot ..
it not works for me when i add a windi.config.ts file at root dir of my project, it works when i remove the windi.config.ts file.
vscode version: 1.56.2 Extension version: 0.17.1
// windi.config.ts
import { defineConfig } from 'windicss/helpers'
export default defineConfig({
darkMode: 'class', // or 'media'
})
@amythos If you have the extension Auto Rename Tag by Jun Han
installed, disable it.
@DaPotatoMan i don't have the Auto Rename Tag
extension
I can confirm that the intellisense stops working when I enabled auto rename tag
@DaPotatoMan i don't have the
Auto Rename Tag
extension
can you provide reproduction steps in an separate issue please
/cc @windicss/windicss tagging this as need guidance
& upstream
since it seems that the 3rd party extension Auto Rename Tag
, hooks into something.
I truly have no idea how to fix this, or what caused this issue,
as far as I can tell, we use native VS Code API, the way it is documented.