Error tracing is quite difficult in Next since it shows the path of the file in the build folder, how can I trace back to where the error originally occurred in my project folder structure?
I have this build error and I just know it’s a CSS error in one of the components since I’m using Tailwindcss
caused by plugins in Compilation.hooks.processAssets
Error: Expected a pseudo-class or pseudo-element.
at /PROJECT_PATH/static/css/c0940a6ef02ebfcf.css:1419:1
at Root._error (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:79306)
at Root.error (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:125621)
at Parser.error (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:87667)
at Parser.expected (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:94001)
at Parser.pseudo (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:90169)
at Parser.parse (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:93524)
at Parser.loop (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:93089)
at new Parser (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:79163)
at Processor._root (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:96105)
at Processor._runSync (/PROJECT_PATH/node_modules/next/dist/compiled/cssnano-simple/index.js:190:96612)
> Build failed because of webpack errors
I’ve set the productionBrowserSourceMaps to true since it’s mentioned in the next.js docs but it didn’t change anything regarding the error traces.
next.config.mjs:
const nextConfig = {
...,
productionBrowserSourceMaps: true,
}