#Postcss loader error on 3.1.1

21 messages · Page 1 of 1 (latest)

inland gulch
#

Hey guys, after I've upgraded my repos to 3.1.1 I'm getting build issues that I can't resolve.

Nuxt build error
  Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
  TypeError: Cannot read properties of undefined (reading 'config')

Also getting this issue on components which have the <style> defined within the component.

'import' and 'export' may appear only with 'sourceType: module'

Reverting back to 3.0.0 resolves the issue.

fallen basalt
#

Hi @inland gulch how did you upgrade?

inland gulch
#

Updated the npm packages and run the upgrade command

fallen basalt
inland gulch
#

I tried removing everything + yarn.lock and then again reinstalling everything

#

but again, same issue

fallen basalt
#

Okay I see. Since nuxt is esm only, maybe this causes the issue here, since it is trying to load postcss-loader. Do you have that installed? maybe you could show your package.json and nuxt.config.ts that would help

inland gulch
#

I'm using the cjs to import a tailwind preset which we share across different pages in my tailwind.config.ts, maybe that's causing the issue?

fallen basalt
#

Try to remove that and check if the error persists

inland gulch
#

Let me try, thank you for taking the time!

inland gulch
#

nice, seems like this is working fine for nuxi dev!

#

let me try generating the static pages, that's where it failed last time

#

same issue, it fails

#

We use webpack for production builds and that's where it seems there is an issue

#
Generated code for node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!/Users/bangjelkoski/dev/injective/injective-helix/node_modules/vue-loader/dist/stylePostLoader.js!/Users/bangjelkoski/dev/injective/injective-helix/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!/Users/bangjelkoski/dev/injective/injective-helix/node_modules/vue-loader/dist/index.js??ruleSet[0]!/Users/bangjelkoski/dev/injective/injective-helix/pages/fee-discounts.vue?vue&type=style&index=0&id=5bf5219c&scoped=true&lang=css
  1 | throw new Error("Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):\nTypeError: Cannot read properties of undefined (reading 'config')\n    at getTailwindConfig (node_modules/tailwindcss/lib/lib/setupTrackingContext.js:84:63)\n    at /Users/bangjelkoski/dev/injective/injective-helix/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:96:92\n    at /Users/bangjelkoski/dev/injective/injective-helix/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11\n    at plugins (/Users/bangjelkoski/dev/injective/injective-helix/node_modules/tailwindcss/lib/index.js:38:63)\n    at LazyResult.runOnRoot (/Users/bangjelkoski/dev/injective/injective-helix/node_modules/postcss/lib/lazy-result.js:339:16)\n    at LazyResult.runAsync (/Users/bangjelkoski/dev/injective/injective-helix/node_modules/postcss/lib/lazy-result.js:393:26)\n    at async Object.loader (/Users/bangjelkoski/dev/injective/injective-helix/node_modules/postcss-loader/dist/index.js:78:14)");
  @ ./pages/fee-discounts.vue?vue&type=style&index=0&id=5bf5219c&scoped=true&lang=css 1:0-583 1:0-583
#

even if I revert back to "@nuxt/webpack-builder": "3.0.0", it still doesn't work

fallen basalt
#

Oh no, webpack 🙈