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
Type-checking development server #69
Comments
Hm, I believe this used to be the case. Need to do some debugging, we might've upgraded it without correcting a logger config or something at one point.
Type checking is used on production builds, i.e., |
Ah, it's a pretty silly issue. In order to ensure your terminal only shows the most recent build info, we clear on every recompile. The issue is the TS error comes before the clear, so you don't end up seeing it. Whoops! For example, let's say I have
If I scroll up, however, I'll see:
|
I should add that this will never result in a failed (dev) build. That is a choice we've made. If you want your dev builds to fail, that's an easy fix you can do right now.
export default (config, env, helpers) => {
if (env.isWatch) {
const { plugin } = helpers.getPluginsByName(config, 'ForkTsCheckerWebpackPlugin')[0];
plugin.async = false;
}
} |
Awesome! 👏
With this fixed the development server should be good to use 🙇 Thanks for preactjs/preact-cli#1635 🚀 |
Hey folks,
I'm using this template right now and I develop by running
npm run dev
and then work on the source code.Now it happened a few times already that I e.g. forgot an import, or mixed up types, or made mistakes in other ways for which I get no feedback from the compiler or type checker. Instead sometimes the rendered dom is just blank, sometimes I get a unrecognizable error in the browser console, and so on.
I thought the benefit of having this typescript template is to use the benefits of typescript for development? But it seems like typescript only comes in play in the
npm run lint script
(Related #67)?Is there a way to have the development server make use of typescript by default, so that we can benefit from types immediately? Or have you folks left it out on purpose? What's the thinking behind this?
The text was updated successfully, but these errors were encountered: