You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add TS support to the Next compiler, so that hot reloading is prevented if there are TypeErrors
Non-Goals
No response
Background
When we run tsc && next dev, if there are any TS errors the process will fail. However, this TS error check only happens on the initial launch. Which means, if I introduce a type error, the hot reload of Next will not throw an error, and will instead reload the page normally.
If I understand correctly, that is because the Next compiler does not use TS.
Can we make it use it?
Proposal
Adding a tsconfig boolean option for the user to choose whether to use TS on hot reload
If that option is set to true: prepend tsc && to the Next compiler command.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
When we run
tsc && next dev
, if there are any TS errors the process will fail. However, this TS error check only happens on the initial launch. Which means, if I introduce a type error, the hot reload of Next will not throw an error, and will instead reload the page normally.If I understand correctly, that is because the Next compiler does not use TS.
Can we make it use it?
Proposal
Adding a tsconfig boolean option for the user to choose whether to use TS on hot reload
If that option is set to true: prepend
tsc &&
to the Next compiler command.Beta Was this translation helpful? Give feedback.
All reactions