question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attributify not working despite not using it

See original GitHub issue

I’m using the Vite plugin, everything updated to the latest version. I turned on Attributify mode:

export default defineConfig({
  attributify: true,
...

and without even using it, it gives me this error:

3:53:13 PM [vite] Internal server error: _this._variants[i] is not a function
      at /home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11282:62
      at Array.map (<anonymous>)
      at /home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11282:18
      at Array.map (<anonymous>)
      at Processor.wrapWithVariants (/home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11277:23)
      at _gStyle (/home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11897:37)
      at /home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11924:53
      at Array.forEach (<anonymous>)
      at _loop_2 (/home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11924:23)
      at Processor.attributify (/home/rehhouari/Projects/web/templates/rapide/node_modules/.pnpm/windicss@3.1.1/node_modules/windicss/lib/index.js:11933:13)

If i use it, it gives me the same error.

I’ve searched and found only https://github.com/windicss/windicss/issues/308#issue-906791858

I assume this is because I’m using Alpine.js which uses attributes? (like x-data, x-text, etc)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
voorjaarcommented, Jun 7, 2021

should been fixed in v3.1.2

0reactions
rehhouaricommented, Jun 6, 2021

one common thing @xorik & @rehhouari have is that it seems to break for both of them if the attribute has a dash - in it…

Could be cause the x in variants that is crashing WindiCSS is most likely part of Alpine.js’ x-text attribute or such

Edit: i’ve looked into @xorik’s use case, it’s not exactly the same. I wasn’t using any windicss attribute. just ones like placeholder, meta tags’ content, and Alpine.js attributes that probably were triggering the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attributify not working despite not using it · Issue #320 - GitHub
I'm using the Vite plugin, everything updated to the latest version. I turned on Attributify mode: export default defineConfig({ ...
Read more >
Windi CSS on Twitter: "One of the coolest new features in v3.0 ...
After a few weeks of hard work, we are excited to announce the Windi CSS ... Attributify allows you to separate them into...
Read more >
Attributify Mode - Windi CSS
Attributify Mode #. ⚠️ Attributify is not available with svelte-windicss-preprocess. With this feature, you can write windi classes in HTML attributes.
Read more >
New features in UnoCSS: A Tailwind CSS alternative
UnoCSS is not a CSS framework, but it is an engine that you can use to create one. ... Provides Attributify Mode to...
Read more >
unocss-applet - npm
Start using unocss-applet in your project by running `npm i unocss-applet`. There are no other projects in the npm registry using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found