Replies: 1 comment 2 replies
-
Guys did you find any solutions? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I really enjoy next.js, but one thing that has been bothering me for months,
is the way compile-time errors are handled.
Let's say I have a custom 'FormGroup' component in the 'shared' folder.
Now I moved this component from the 'shared' folder to the 'inputs' folder.
(I know auto-import-correction exists, but this example is just meant to illustrate some kind of component/api change, which affects multiple components)
When I run 'npm run dev', however, no compile-time errors appear. It is only once I navigate to a specific page,
where the error occurs, that I get a notification.
I find this behavior to be quite annoying, as one is only alerted by errors, once one tries to build/publish the app finally.
Furthermore when running 'npm run build', the compiler stops after the first occurrence of the error (in this case page1.tsx),
it doesn't even check page2.tsx.
Let's say I had used the 'FormGroup' component is 100 other components (which isn't uncommon at all), I would have
to run 'npm run build' 100 separate times, and fix each occurrence one by one.
See the example here: https://github.com/Tobjoern/nextjs-errors-demo
I'm still relatively new to next.js, so maybe I'm missing something, but I find the way nuxt.js handles this to be a lot better.
I created the same example here: https://github.com/Tobjoern/nuxtjs-error-demo
When I run 'npm run dev' it immediately shows me ALL the errors I have in the console, I can easily jump to the individual files,
in order to fix them.
Is there some setting I don't know about?
I'd be happy to hear your thoughts!
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions