Nextjs production build throwws HookWebpackError
& Unclosed block
. Local dev works fine
#16040
-
Hello! I've ran the the script │ Searching for CSS files in the current directory and its subdirectories…
│ ↳ Linked `./tailwind.config.ts` to `./src/styles/global.css`
│ Migrating JavaScript configuration files…
│ ↳ Migrated configuration file: `./tailwind.config.ts`
│ Migrating templates…
│ ↳ Migrated templates for configuration file: `./tailwind.config.ts`
│ Migrating stylesheets…
│ ↳ Migrated stylesheet: `./src/styles/global.css`
│ Migrating PostCSS configuration…
│ ↳ Installed package: `@tailwindcss/postcss`
│ ↳ Removed package: `autoprefixer`
│ ↳ Migrated PostCSS configuration: `./postcss.config.mjs`
│ Updating dependencies…
│ ↳ Updated package: `prettier-plugin-tailwindcss`
│ ↳ Updated package: `tailwindcss` Then I tried it locally, and it works like a charm. But when I try to build my project (locally & Netlify) I get HookWebpackError: <REDACTED>/static/css/2debee323827dbd3.css:2:45286: Unclosed block
at makeWebpackError (<REDACTED>/node_modules/next/dist/compiled/webpack/bundle5.js:28:314608)
at <REDACTED>/node_modules/next/dist/compiled/webpack/bundle5.js:28:106402
at eval (eval at create (<REDACTED>/node_modules/next/dist/compiled/webpack/bundle5.js:13:9218), <anonymous>:44:1)
-- inner error --
CssSyntaxError: <REDACTED>/static/css/2debee323827dbd3.css:2:45286: Unclosed block
at Input.error (<REDACTED>/node_modules/next/node_modules/postcss/lib/input.js:106:16)
at ScssParser.unclosedBlock (<REDACTED>/node_modules/next/node_modules/postcss/lib/parser.js:574:22)
at ScssParser.endFile (<REDACTED>/node_modules/next/node_modules/postcss/lib/parser.js:336:35)
at ScssParser.parse (<REDACTED>/node_modules/next/node_modules/postcss/lib/parser.js:475:10)
at scssParse (<REDACTED>/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:322)
at new LazyResult (<REDACTED>/node_modules/next/node_modules/postcss/lib/lazy-result.js:133:16)
at Processor.process (<REDACTED>/node_modules/next/node_modules/postcss/lib/processor.js:53:14)
at CssMinimizerPlugin.optimizeAsset (<REDACTED>/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:48:12)
at <REDACTED>/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:79:55
at async Span.traceAsyncFn (<REDACTED>/node_modules/next/dist/trace/trace.js:153:20)
caused by plugins in Compilation.hooks.processAssets
CssSyntaxError: <REDACTED>/static/css/2debee323827dbd3.css:2:45286: Unclosed block
at Input.error (<REDACTED>/node_modules/next/node_modules/postcss/lib/input.js:106:16)
at ScssParser.unclosedBlock (<REDACTED>/node_modules/next/node_modules/postcss/lib/parser.js:574:22)
at ScssParser.endFile (<REDACTED>/node_modules/next/node_modules/postcss/lib/parser.js:336:35)
at ScssParser.parse (<REDACTED>/node_modules/next/node_modules/postcss/lib/parser.js:475:10)
at scssParse (<REDACTED>/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:322)
at new LazyResult (<REDACTED>/node_modules/next/node_modules/postcss/lib/lazy-result.js:133:16)
at Processor.process (<REDACTED>/node_modules/next/node_modules/postcss/lib/processor.js:53:14)
at CssMinimizerPlugin.optimizeAsset (<REDACTED>/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:48:12)
at <REDACTED>/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:79:55
at async Span.traceAsyncFn (<REDACTED>/node_modules/next/dist/trace/trace.js:153:20) What I've tried
I only have a single CSS file, so I'm surprised that I read scss in the logs Any ideas on where to look? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 9 replies
-
Consider providing a project that reproduces the unexpected behavior. |
Beta Was this translation helpful? Give feedback.
-
Tried without the migration script.
same error |
Beta Was this translation helpful? Give feedback.
-
I've traced it to my |
Beta Was this translation helpful? Give feedback.
-
Looking further it's a post about |
Beta Was this translation helpful? Give feedback.
-
This makes zero sense but here's what broke
updated to
cc @wongjn |
Beta Was this translation helpful? Give feedback.
-
I use both tailwindcss and scss same time. Also local dev fine. prod build failed. This is my workaround "@tailwindcss/postcss": {
optimize: { minify: false },
}, |
Beta Was this translation helpful? Give feedback.
-
I have the same problem when running the |
Beta Was this translation helpful? Give feedback.
-
Im facing the same issue, could you tell me a bit more about this error, for I dont have any of that cloudinary integration but I am getting images from server, and where exactly in the code did it break? |
Beta Was this translation helpful? Give feedback.
This makes zero sense but here's what broke
updated to
cc @wongjn