Home > Net >  Nextjs HookWebpackError: Cannot set properties of undefined (setting 'type')
Nextjs HookWebpackError: Cannot set properties of undefined (setting 'type')

Time:08-27

Im getting this error when i try to build my nextjs app. This error didn't occur on the last version of my app though, I didn't play with any config file, only added a couple of animation libraries and thats it, in addition to the code I wrote of course.

repo link: https://github.com/aliSalehAbdulhadi/Daily adding-inner-todos branch

yarn run v1.22.19
$ next build
info - Linting and checking validity of types
info - Creating an optimized production build
Failed to compile.

HookWebpackError: Cannot set properties of undefined (setting 'type')
at makeWebpackError (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/webpack/bundle5.js:49590:9)
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/webpack/bundle5.js:33095:12
at eval (eval at create (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/webpack/bundle5.js:23385:10), :34:1)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
-- inner error --
TypeError: Cannot set properties of undefined (setting 'type')
at /home/ali/Desktop/development/projects/daily-app/static/css/04a7d2f9c1ff8270.css:1335:3
at flatten (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:64125)
at getValue (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:63922)
at normalizeBoxShadow (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:67038)
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:63635
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:72:18
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:55:18
at Rule.each (/home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:41:16)
at Rule.walk (/home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:52:17)
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:60:24
at Root.each (/home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:41:16)
caused by plugins in Compilation.hooks.processAssets
TypeError: Cannot set properties of undefined (setting 'type')
at /home/ali/Desktop/development/projects/daily-app/static/css/04a7d2f9c1ff8270.css:1335:3
at flatten (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:64125)
at getValue (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:63922)
at normalizeBoxShadow (/home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:67038)
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/dist/compiled/cssnano-simple/index.js:190:63635
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:72:18
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:55:18
at Rule.each (/home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:41:16)
at Rule.walk (/home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:52:17)
at /home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:60:24
at Root.each (/home/ali/Desktop/development/projects/daily-app/node_modules/next/node_modules/postcss/lib/container.js:41:16)

Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

CodePudding user response:

I cloned your repository and made a build, it gave no error! I think it's a problem with your local configuration.

CodePudding user response:

It was a CSS syntax error, which didn't appear during development but only during build time. Keep that in mind to anyone who might see this.

  • Related