yarn generate not creating _nuxt directory

Hi everyone, I was wondering in what occasions a 'yarn generate' would not create an _nuxt directory? We currently have a gitlab CI/CD pipeline, in which we build our nuxt app 3 times for 3 different locales. Sometimes the _nuxt dir is not created, even though the build does not contain any errors. It also occurs sporadically on different locales, so the problem is not consistent which makes debugging difficult. The latter also makes content or environment issues unlikely. We also run the same pipeline for our acceptation environment, which runs fine and also correctly creates the _nuxt dir consistently for all locales.
10 Replies
kapa.ai
kapa.ai4w ago
Hi @ceesvanmook. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not contain explicit information about all the possible reasons why running yarn generate in a Nuxt project would sporadically fail to create the _nuxt directory, especially in a CI/CD pipeline context. However, there are some related issues and troubleshooting steps that may help: - In Nuxt 3, the output of the build and generate commands is typically placed in the .output directory, not directly in a _nuxt directory. The _nuxt directory is usually found inside .output/public/_nuxt for static assets. If you are expecting a top-level _nuxt directory, ensure your pipeline is referencing the correct output path for your Nuxt version and configuration [Nuxt3 build .output folder remains empty, nothing copied from .nuxt Part 1]. - There are reports of the .output (and by extension, the _nuxt directory inside it) being empty after a build, with no errors shown. In at least one case, the issue was resolved by creating a new Nuxt project and carefully copying files over, suggesting that subtle configuration or project structure issues can cause this problem [Nuxt3 build .output folder remains empty, nothing copied from .nuxt Part 4]. - No knowledge source provides a definitive list of causes for sporadic failures in generating the _nuxt directory, especially when the build logs show no errors and the issue is inconsistent. Given the sporadic nature and the lack of errors, possible areas to investigate (though not directly confirmed by the sources) include: - File system or caching issues in the CI environment. - Race conditions or parallel builds interfering with each other. - Differences in environment variables or configuration between successful and failed runs. If you are using Nuxt 3, double-check that you are looking for the generated assets in the correct location (.output/public/_nuxt). If you are on Nuxt 2, the _nuxt directory should be generated at the root of the output directory. Unfortunately, the knowledge sources do not provide a more specific answer to your question. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4w ago
<@705485241090965615> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
danielroe
danielroe4w ago
this should never happen! but, just to be clear, you're talking about .output/public/_nuxt, right?
ceesvanmook
ceesvanmookOP3w ago
Hi Daniel, Thanks you for responding! Yes that's what i'm referring to. I'm currently trying to rule out that the deploys, which run parallel, are not the issue by trying to run them one after another. That did not fix it unfortunately.. We're currently running on Nuxt 3.17.5 by the way. @danielroe Are you able to help us further? We're kinda stuck at the moment.
danielroe
danielroe3w ago
can you create a reproduction? it seems to me like your issue is likely to be a caching configuration problem. are you using something like nx or turborepo? nuxt will always create that folder when building so the only thing that is likely not to create it is if you are somehow skipping the build entirely
ceesvanmook
ceesvanmookOP3w ago
Hi @danielroe, Thanks for responding! It's difficult for us to create a reproduction, as it seems to be working fine when building locally. The issue arises in the build pipeline in Gitlab. They also fail inconsistently between locales. I also thought it might be the caching in the pipeline, but after removing the cache from the pipeline it still occurs. Would it help if i drop my gitlab CI file and/or nuxt config?
danielroe
danielroe3w ago
you can try but I can't guarantee anything
Kealtie
Kealtie3w ago
Hi, I am a colleague of Cees. We've been trying different approaches; disabling payloadExtraction, disabling sentry and sourcemap uploads. The problem is that the generate proces seems to close prematurely sometimes. The site this is happening on has 3 locales and it happens at random at all three of them, so this couldn't be a content issue. I've been able to reproduce it only once locally, so it also doesn't seem to be a CI/CD thing. It seems to prematurely close the proces after the last _payload.json of the prerendered pages are generated.
danielroe
danielroe3w ago
I am assuming then it must be an issue with a module you have (or some code)? perhaps try removing a module at a time until you identify the one causing the issue?
Kealtie
Kealtie3w ago
Thanks for the advice, will try!

Did you find this page helpful?