Display ALL build errors, instead of stopping at the first one
Hey there π
I am migrating a vue / inertia app to nuxt, it's been great so far but I still have a lot invalid imports errors, missing components and so on.
These errors do not show up in dev mode (due to lazy loading I guess), but they do when building the app.
The issue is that the build process stops whenever it encounters an error, so I have to fix the error and re-run the build to know what the next error is which is time consuming.
Is there a way to make the build go all the way through so I have a complete list of errors?
Already tried increasing the log level, and enabled nitro debug but both makes no difference.
Regards,

4 Replies
Hi @LordApo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I understand your frustration with the build process stopping at the first error during migration. Unfortunately, based on the knowledge sources provided, there isn't a direct configuration option in Nuxt that allows the build process to continue after encountering errors and collect all errors at once.
The build process in Nuxt is designed to fail fast when it encounters errors, which is why it stops at the first error. This is particularly true for fatal errors during the build or prerendering process, as seen in some of the issues mentioned in the knowledge sources.
However, here are some approaches that might help you identify more errors at once:
1. Use Nuxt Devtools: The Nuxt Devtools provides comprehensive insights into your application, including components, imports, and more. This might help you identify potential issues before building. Nuxt Devtools Features
2. Enable Debugging: While you mentioned you've tried increasing log levels, you might want to specifically enable sourcemaps for better error tracing:
3. Error Handling Hooks: Nuxt provides several hooks for error handling, such as
build:error
and vue:error
. You might be able to use these to capture errors without stopping the build, though this would require custom implementation. Nuxt Hooks (build time)
4. Incremental Migration: Consider migrating your application in smaller chunks, ensuring each part works correctly before moving on to the next.
Recent improvements have been made to error reporting in Nuxt, particularly for prerendering errors and middleware errors, but these don't specifically address collecting all build errors at once.
If this is a critical need for your workflow, you might want to consider opening a feature request in the Nuxt GitHub repository, as this functionality could be valuable for migration scenarios like yours.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@149182718645764096> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Maybe
nuxt typecheck
will do the trick? If your imports are incorrect, typecheck should fail too.I don't have a lot of ts components, but it does help for the ones that are π Thanks
I also bridged the gap with eslint, at least for incorrect imports