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.

next build hangs forever after upgrade to v8

See original GitHub issue

Bug report

Describe the bug

I’ve upgraded to Next.js 8 and noticed my next build (which is triggered by yarn build) leaves process hanging forever and doesn’t exit it. So, my CI is timing out and we can’t push the upgrade to production yet.

To Reproduce

Simply running next build. Here’s my current next.config.js:

const webpack = require('webpack')
const path = require('path')
const package = require('./package.json')
const DotenvPlugin = require('dotenv-webpack')
const withProgressBar = require('next-progressbar')
const withOffline = require('next-offline')
const withCSS = require('@zeit/next-css')
const isProduction = process.env.NODE_ENV === 'production'

module.exports = withOffline(withCSS(withProgressBar({
  progressBar: {
    profile: true,
  },

  workboxOpts: {
    runtimeCaching: [
      {
        urlPattern: /^https?.*/,
        handler: 'networkFirst',
        options: {
          cacheName: 'name-v' + package.version,
          expiration: {
            maxEntries: 50,
            maxAgeSeconds: 7 * 24 * 60 * 60,
            purgeOnQuotaError: true,
          },
        },
      },
    ],
  },

  webpack: (config, { isServer }) => {
    config.plugins.push(new DotenvPlugin({
      systemvars: isProduction,
    }))

    if (!isServer) {
      config.module.rules.unshift({
        test: /\.worker\.js$/,
        use: [{
          loader: 'worker-loader',
          options: {
            inline: true,
          },
        }],
      })
    }

    /**
     * Hotfix for new webpack hot reload bug
     */
    if (!isServer) {
      config.output.globalObject = 'self'
    }

    return config
  },
})))

Expected behavior

Process should exit after compilation is successful.

Screenshots

Screen Shot 2019-06-25 at 12 30 18

System information

  • OS: macOS Mojave 10.14.3 (but same thing occurs in CircleCI, which I believe runs some Linux distro)
  • Browser (if applies): N/A
  • Version of Next.js: ^8.1.0

Additional context

Not many changes, I simply upgraded Next from v7 to v8. It also seems to have no warnings of peer dependencies compatibility issues. Everything else is running fine. If I ctrl+C the build process and run yarn start, everything is working just fine. Development server is working perfectly as well.

I found similar issues (https://github.com/zeit/next.js/issues/7567, https://github.com/zeit/next.js/issues/4647, https://github.com/zeit/next.js/issues/6419) suggesting to install next-progressbar, removing node_modules, yarn.lock, package-lock.json, .next directory etc. I did all of that but absolutely nothing changed this outcome.

Any thoughts? Thanks 😅

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Timercommented, Jun 25, 2019

Can you please try next@canary? I assume one of your pages is establishing a connection or similar and never allows the process to exit.

2reactions
Timercommented, Jun 26, 2019

Closing this because you said it works @gugiserman!

Read more comments on GitHub >

github_iconTop Results From Across the Web

next build hangs forever after upgrade to v8 #7667 - GitHub
I've upgraded to Next.js 8 and noticed my next build (which is triggered by yarn build ) leaves process hanging forever and doesn't...
Read more >
Next Build hangs forever - Stack Overflow
I solved it by upgrading node version from v16.13.0 to v16.14.0 . Share.
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
Understanding why our build got 15x slower with Webpack 5
A while back, we encountered an odd problem. All of a sudden, building our front-end went from taking a few seconds to taking...
Read more >
npm run watch command stuck - Laracasts
Try to remove your package-lock.json and node_modules and reinstall your modules again. Also try to use the "--verbose" flag to see more details....
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