Poimen / stencil-tailwind-plugin

Plugin for using tailwindcss with StencilJS
https://www.npmjs.com/package/stencil-tailwind-plugin
MIT License
51 stars 5 forks source link

defaultExtractor error after update #25

Closed dnnsjsk closed 2 years ago

dnnsjsk commented 2 years ago

Hey,

I am running newest Tailwind (3.1.8) and plugin version (1.5.1) and I am getting following error:

[ERR] Oh noes! Something went wrong! Cannot read properties of undefined (reading 'separator')
[ERR] TypeError: Cannot read properties of undefined (reading 'separator')
    at buildRegExps (/Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/tailwindcss/lib/lib/defaultExtractor.js:67:44)
    at buildRegExps.next (<anonymous>)
    at Function.from (<anonymous>)
    at defaultExtractor (/Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/tailwindcss/lib/lib/defaultExtractor.js:51:26)
    at b (/Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/purgecss/lib/purgecss.js:1:4289)
    at PurgeCSS.extractSelectorsFromFiles (/Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/purgecss/lib/purgecss.js:1:6443)
    at async /Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/@fullhuman/postcss-purgecss/lib/postcss-purgecss.js:1:1153
    at async LazyResult.runAsync (/Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/postcss/lib/lazy-result.js:433:15)
    at async I (/Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/stencil-tailwind-plugin/dist/index.js:7:4202)
    at async /Users/dennis/Local Sites/fabrikat/app/public/wp-content/plugins/streamline/package/node_modules/stencil-tailwind-plugin/dist/index.js:7:7752

It goes away when I don't use the defaultExtractor.

Poimen commented 2 years ago

Apologies, that purge setup is not a requirement anymore. It was a throw back from when the JIT in Tailwind wasn't always enabled. Now that JIT is always enabled, there is no need for the purge option.

I have removed it from the README now. You should be able to just remove the purge setup and it should work fine.

dnnsjsk commented 2 years ago

That's what I thought, thanks!