-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nuxi prepare
or build
hangs
#169
Comments
Start a new pull request in StackBlitz Codeflow. |
@danielroe I Guess this is only happening when preset is static , Checked on Windows / MaC .
|
Update : Found out it was unable to build '@vuestic/nuxt', removing it from nuxt.config.ts made the terminal to conttinue to start server, but the issue is not fixed, it was working well in nuxt 3.5.2 release. |
I have the same problem but I'm not using @vuestic/nuxt. It's stuck on:
[success] Types generated in .nuxt |
This is caused by vuestic/nuxt registering a watcher, without signalling it to close. I've opened epicmaxco/vuestic-ui#3748 to fix that. @pi0, I think we should probably still exit nuxi even if watchers are still around - can you think what might be causing this? |
@danielroe I also have the same problem but I'm not using vuestic. Some core libs like nuxt/content, nuxt/image-edge, fontaine etc. The only third party package is 'nuxt-content-assets'. Please let me know if you want me to create a separate issue for that. |
same problem with static used for some pages |
Had the same issue; removing the 'nuxt-content-assets' module resolved it. |
Same issue and I am not using vuestic/nuxt or nuxt-content-assets (edit) I realized that removing the module nuxt-mongoose resolves this issue but I don't know if is a problem of the module or how I implement it. |
Happens for me too when prerendering any route (even /sitemap.xml) when the app uses @nuxt/image. Other apps that dont use @nuxt/image can prerender fine. |
It looks like this problems can be caused by many libraries like vuestic, nuxt-content-assets and @nuxt/image. I'm prerendering sitemap in my project so it may be connected. |
Also in |
I am not sure if the main issue of For last issue with |
Nuxt Content Assets author here. Happy to help if possible, but Nuxt development moves so quickly, I'm not sure I can. @pi0 - any advice on where to look in my module? For the time being, I'll upgrade to Nuxt 2.8 in the module demo folder, and will create a new issue with the demo folder being the reproduction if it happens there. |
A note from nuxt/nuxt#23334, nitro pre-renderer does not calls |
using workaround given by @pi0 here : This workaround has nasty side effect: |
Occurring for me when running If I remove that configuration, I can use |
Using
This is what I added to the
Would it make sense add something like this to the Nuxt codebase itself? |
This seems like it might possibly be relevant: This is almost certainly because of this: As, with the
hm... even if i have node kill these, the process is not closing. which seems to suggest it's something internal like a promise that is not resolving.. |
When prerendering and using node-cron, build hangs import cron from 'node-cron'
export default defineNitroPlugin(async () => {
startCron()
})
function startCron() {
cron.schedule('0 4 * * *', async () => {
console.warn('Running scheduled task')
})
console.warn('Cron started' |
Is there a way to detect if the environment is running for pre-rendering? That way we can skip things like cron when pre-rendering and avoid problems like that. |
@unitythemaker You can use |
Neither of those work out of the box within the nuxt |
any progress on this? my im not using any of these 3 libraries vuestic, nuxt-content-assets and @nuxt/image |
check if any module or plugin you're using has a |
We got the same issue and wasn't able to find the module or plugin that made our build process hang. It started happening after updating Nuxt and packages. Only esbuild was still running. We tried killing esbuild on close hook, but no luck. It's hacky, but we ended up just exiting the process on hooks: {
close: (nuxt) => {
if (!nuxt.options._prepare) {
process.exit();
}
},
}, |
I'm running Also hanging on: |
I got this to work by doing the opposite of what @ngajhede did: close: (nuxt) => {
if (nuxt.options._prepare) {
process.exit()
}
} |
I feel like it might be useful to have some sort of "registry" of promises or long running timers so we could alert the user and even cleanly close them/time them out ofter generating. How bad would it be to extend/override/wrap the Promise class and timers to do this sort of thing? I know this could have an effect on garbage collection, but the benefits might outweigh the negatives, and even enhance troubleshooting or debugging memory issues. |
UPDATE: Looks like my build was also hanging after it was complete like reported by other people, so I just changed the hook to: /** @see https://github.com/nuxt/cli/issues/169 */
close: () => {
process.exit()
} Update of update: This doesn't work. It fails to build tsconfig.json, so I'm not sure what to do. If I remove the close hook, it builds tsconfig.json, but then never ends the build / prepare |
Try and isolate the root cause, it seems to differ from project to project, I would probably clone a minimal version of your project with plugins and dependencies, then step through one by one disabling each to see if it still hangs. |
@L422Y Thank you!! It was my own derpy fault for not understanding how Nuxt modules work or when they run. I added a |
I had this problem in Nuxt-Bridge with vite:false. Now that I am upgrading to 3 with vite:true, it doesnt hang anymore. |
Just upgraded a project to the latest Nuxt 10.3 , and it builds locally but stalls on Netlify. However, adding the fix mentioned above allows Netlify to proceed to the build step, with seemingly no adverse effects: // nuxt.config.ts
hooks: {
close: () => {
// @see https://github.com/nuxt/cli/issues/169#issuecomment-1729300497
// Workaround for https://github.com/nuxt/cli/issues/169
process.exit(0)
}
}, As I understand from the other comments:
@pi0 / @danielroe – what would be the best way for Nuxt Content Assets to mitigate this problem for its users?
I don't understand the underlying mechanisms / reasons well enough to make that decision, so if you could make a recommendation I would appreciate it. Thanks. |
I am facing this issue after installing the Nuxt build does not end even if all the buildings process completed Nuxt Version: 3.11.2 |
That would be a bug in the content module then. Would you open an issue on nuxt/content with a reproduction? Feel free to tag me. |
For anyone still encountering this, a reminder that this typically occurs because of non-Nuxt code, typically within modules, but it can be anything that leaves something un-cleaned-up, such as a watcher. I looked into the repo in #193 and also found an issue with Nitro, which was likely also at play: nitrojs/nitro#2287 If you're still encountering something like this in your project after that point, please open a new issue with a reproduction and I'll happily look into it further 🙏 |
I'm seeing this when turning on Also only happens building in a docker container (matching bun version). Even if I delete |
Environment
Reproduction
https://stackblitz.com/edit/github-khexbq?file=package.json
Describe the bug
Doing a npm install stucks at the above position , doing a npx nuxi upgrade --force fixes the issue,
Conflicting during deploying .
Additional context
No response
The text was updated successfully, but these errors were encountered: