Skip to content

Build Error: HookWebpackError with cssnano-simple #74

@SmallhillCZ

Description

@SmallhillCZ

Spent a day with this, nothing helps.

This looks very close: vercel/next.js#68476

$ npm run build

> metacity-studio@1.0.1 build
> next build --debug

  ▲ Next.js 14.2.11
  - Environments: .env

   Creating an optimized production build ...
Failed to compile.

HookWebpackError: Cannot read properties of undefined (reading 'length')
    at makeWebpackError (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/webpack/bundle5.js:28:312635)
    at /workspaces/pds-studio/studio/node_modules/next/dist/compiled/webpack/bundle5.js:28:106060
    at eval (eval at create (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/webpack/bundle5.js:13:28858), <anonymous>:44:1)
-- inner error --
TypeError: Cannot read properties of undefined (reading 'length')
    at equals (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:9716)
    at dedupeNode (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:10143)
    at dedupe (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:10378)
    at OnceExit (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:10483)
    at LazyResult.runAsync (/workspaces/pds-studio/studio/node_modules/next/node_modules/postcss/lib/lazy-result.js:298:21)
    at async /workspaces/pds-studio/studio/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:79:44
    at async Span.traceAsyncFn (/workspaces/pds-studio/studio/node_modules/next/dist/trace/trace.js:154:20)
    at async Promise.all (index 16)
    at async /workspaces/pds-studio/studio/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:67:21
    at async Span.traceAsyncFn (/workspaces/pds-studio/studio/node_modules/next/dist/trace/trace.js:154:20)
caused by plugins in Compilation.hooks.processAssets
TypeError: Cannot read properties of undefined (reading 'length')
    at equals (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:9716)
    at dedupeNode (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:10143)
    at dedupe (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:10378)
    at OnceExit (/workspaces/pds-studio/studio/node_modules/next/dist/compiled/cssnano-simple/index.js:190:10483)
    at LazyResult.runAsync (/workspaces/pds-studio/studio/node_modules/next/node_modules/postcss/lib/lazy-result.js:298:21)
    at async /workspaces/pds-studio/studio/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:79:44
    at async Span.traceAsyncFn (/workspaces/pds-studio/studio/node_modules/next/dist/trace/trace.js:154:20)
    at async Promise.all (index 16)
    at async /workspaces/pds-studio/studio/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js:67:21
    at async Span.traceAsyncFn (/workspaces/pds-studio/studio/node_modules/next/dist/trace/trace.js:154:20)


> Build failed because of webpack errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions