next build hangs forever after upgrade to v8
See original GitHub issueBug 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
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:
- Created 4 years ago
- Reactions:2
- Comments:8 (3 by maintainers)

Top Related StackOverflow Question
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.Closing this because you said it works @gugiserman!