https://codesandbox.io/s/z6o0ql1o03
Go to the server control panel and try the 'build' command.
The build should finish or an error message should show.
The build hangs after all files are compiled with no output explaining why this might be happening. The final line shows Entrypoint app = server.js server.js.map and I expect the build to finish there and the start command to run. The application can start successfully at that point it seems.
I'm not sure which version this started happening in, but I'm going to start rolling back to previous versions of nuxt to try and see. I'm using the express server middleware as shown in the template and I just cannot figure out why this isn't working. It doesn't work even with valid mysql database connection credentials - I am using correct details in my local build and have checked that all the information resolves to a local mysql database that should accept the connection.
I'm thinking perhaps there is a promise that isn't resolving, but I am at a loss right now.
Any clues on how to best debug this and figure out what is happening would be hugely appreciated. I'm looking to get a website launched ASAP which this is preventing at the moment.
Thanks very much in advance!
The issue is still occurs if I roll back the package express-mysql-session to 2.0.1 which is one that was working in a previous project.
I then rolled back Nuxt to 2.3.4 with express-mysql-session ^2.1.0 - this build works
The issue was introduced in Nuxt 2.4.0 - it seems a lot of work was done on that release so perhaps it won't be the easiest to trace, but if there are any hints anyone could give that I could do to save package maintainers time in figuring this one out then I'm more than happy to do it.
Thanks!
Hi @silverbackdan
This issue is related to #4944 and fixed by #4958.
Actually the patch release is not published yet.
In the mean time you can use this hook in your nuxt.config.js:
hooks: {
build: {
done(builder) {
if (!builder.nuxt.options.dev) {
setTimeout(() => process.exit(0), 1000);
}
}
}
},
This will close the build process in production.
Thanks both! Shame it just missed the release, so close! haha. I'll keep an eye out though and use the fix suggested above for now.
Closing here as the next fix patch is coming soon, the workaround is present in nuxt-edge already and @Timkor provided a direct workaround 鈽猴笍
Most helpful comment
In the mean time you can use this hook in your
nuxt.config.js:This will close the build process in production.