question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'pop' of undefined

See original GitHub issue

Bug report

Describe the bug

next build failed after upgrade to 9.2.0

Failed to compile.

chunk commons [initial]
static/chunks/commons.c26e165c.chunk.css
Cannot read property 'pop' of undefined

> Build error occurred
Error: > Build failed because of webpack errors
    at build (/home/ubuntu/app/node_modules/next/dist/build/index.js:10:900)
    at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

Build success

System information

  • OS: Ubuntu 18
  • Version of Next.js: 9.2.0
  • Node: 8.12.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:41 (16 by maintainers)

github_iconTop GitHub Comments

24reactions
ivadimkocommented, Jan 20, 2020

node v10.16.0 - the same error node v12.12.0 - the same error

only thing that helped is adding

    if (config.optimization.splitChunks) {
      config.optimization.splitChunks.cacheGroups.shared.enforce = true;
    }

in my next.config.js

15reactions
jackguoAtJoggcommented, Aug 25, 2020

I found the solution by combine the solution with this comment: https://github.com/webpack-contrib/mini-css-extract-plugin/issues/341#issuecomment-675603278

In my next.config.js under webpack(config)

if (config.optimization.splitChunks) {
                    config.optimization.splitChunks.cacheGroups.shared = {
                        name: 'app-other',
                        test: /\.css$/,
                        chunks: 'all',
                        enforce: true,
                    }
                }

I hope this will solve issue for whoever runs into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'pop' of undefined || next.js
config.js the project is perfectly working while i am using this a npm run dev can anyone help me here what is the...
Read more >
How to Fix TypeError: Cannot read Property 'push' of ...
How to Fix TypeError: Cannot read Property 'push' of Undefined in JavaScript · Calling the method on a variable that was previously set...
Read more >
登录 - 书阙
Web site created using create-react-app.
Read more >
Uncaught TypeError: Cannot read property 'pop' of undefined
we're having this error on the backend editing elements on the visual editor. you can see the contents on preview but nothing is...
Read more >
Cannot read property 'pop' of undefined - velog
Detail 과 User 파일 모두 같은 starRate() 함수를 사용하는데 이상하게 User 파일의 starRate() 에서 오류가 발생했다. 방법1. 에러 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found