rspack-contrib / rsbuild-plugin-tailwindcss

An Rsbuild plugin to integrate with Tailwind CSS
MIT License
12 stars 1 forks source link

[BUG] Cannot read properties of undefined (reading 'insertAfter') #16

Open BleedingDev opened 4 days ago

BleedingDev commented 4 days ago

Hi, I tried to use this plugin and it fails with following error:

start   Building...
<e> [webpack-dev-middleware] [Error:   × TypeError: Cannot read properties of undefined (reading 'insertAfter')
<e>   │     at Root.after (D:\Side\nmit-coursition\node_modules\.pnpm\rsbuild-plugin-tailwindcss@0.0.2_@rsbuild+core@1.1.3_tailwindcss@3.4.15_ts-node@10.9.2_@swc+c_iea46vmxfpnftq2zpelg5joqme\node_modules\rsbuild-plugin-tailwindcss\dist\880.cjs:1633:29)
<e>   │     at partitionRules (D:\Side\nmit-coursition\node_modules\.pnpm\tailwindcss@3.4.15_ts-node@10.9.2_@swc+core@1.5.25_@swc+helpers@0.5.15__@types+node@20.17.6_typescript@5.6.3_\node_modules\tailwindcss\lib\lib\partitionApplyAtRules.js:49:18)
<e>   │     at D:\Side\nmit-coursition\node_modules\.pnpm\tailwindcss@3.4.15_ts-node@10.9.2_@swc+core@1.5.25_@swc+helpers@0.5.15__@types+node@20.17.6_typescript@5.6.3_\node_modules\tailwindcss\lib\lib\partitionApplyAtRules.js:56:9
<e>   │     at D:\Side\nmit-coursition\node_modules\.pnpm\tailwindcss@3.4.15_ts-node@10.9.2_@swc+core@1.5.25_@swc+helpers@0.5.15__@types+node@20.17.6_typescript@5.6.3_\node_modules\tailwindcss\lib\processTailwindFeatures.js:54:46
<e>   │     at async plugins (D:\Side\nmit-coursition\node_modules\.pnpm\tailwindcss@3.4.15_ts-node@10.9.2_@swc+core@1.5.25_@swc+helpers@0.5.15__@types+node@20.17.6_typescript@5.6.3_\node_modules\tailwindcss\lib\plugin.js:38:17)
<e>   │     at async LazyResult.runAsync (D:\Side\nmit-coursition\node_modules\.pnpm\rsbuild-plugin-tailwindcss@0.0.2_@rsbuild+core@1.1.3_tailwindcss@3.4.15_ts-node@10.9.2_@swc+c_iea46vmxfpnftq2zpelg5joqme\node_modules\rsbuild-plugin-tailwindcss\dist\880.cjs:949:25)      
<e>   │     at async D:\Side\nmit-coursition\node_modules\.pnpm\rsbuild-plugin-tailwindcss@0.0.2_@rsbuild+core@1.1.3_tailwindcss@3.4.15_ts-node@10.9.2_@swc+c_iea46vmxfpnftq2zpelg5joqme\node_modules\rsbuild-plugin-tailwindcss\dist\index.cjs:268:49
<e>   │     at async Promise.all (index 0)
<e>   │     at async D:\Side\nmit-coursition\node_modules\.pnpm\rsbuild-plugin-tailwindcss@0.0.2_@rsbuild+core@1.1.3_tailwindcss@3.4.15_ts-node@10.9.2_@swc+c_iea46vmxfpnftq2zpelg5joqme\node_modules\rsbuild-plugin-tailwindcss\dist\index.cjs:264:21
<e>   │     at async Promise.all (index 0)
<e>   │     at async Object.fn (D:\Side\nmit-coursition\node_modules\.pnpm\rsbuild-plugin-tailwindcss@0.0.2_@rsbuild+core@1.1.3_tailwindcss@3.4.15_ts-node@10.9.2_@swc+c_iea46vmxfpnftq2zpelg5joqme\node_modules\rsbuild-plugin-tailwindcss\dist\index.cjs:237:17)
<e>   │ 
<e> ] {
<e>   code: 'GenericFailure'
<e> }

Anything I should do differently? :) I am trying to consume UI Library (Shadcn) and also use styles in the app (I have Nx Monorepo, which I can share).

colinaaa commented 4 days ago

Hi @BleedingDev, it would be great if you could provide the repo that can re-produce this problem

BleedingDev commented 21 hours ago

Sure thing, I'll try to do minimal reproduction example, sorry for not adding it immediately.

In the end I got it working, but without the plugin. Here's the app inside Nx Monorepo. https://github.com/NaucMeIT/web/tree/master/apps/coursition-new-rs

I had to remove this plugin from RsBuild config, so it's not there as of now.