-
-
Notifications
You must be signed in to change notification settings - Fork 225
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 'Timeout' is not assignable to type 'number'. #773
Comments
Does that error occur only after you installed the MQTT package? Most likely that MQTT package has some node dependencies, which caused the mixup with the TS timer as explained here: microsoft/TypeScript#32133. Edit: Everything is building fine for me with the current master, that's why I'm asking :) |
Interesting, yes! It started to pop up along the way after I installed a few extra packages (I added the material grid view, ngx-mqtt, and rxjs.) The |
Yeah the „problem“ is that the MQTT package probably does have a node dependency. Node.js and TypeScript each define their own setTimeout function (one returning a TimeOut and the other one returning a number). If the node types are included (due to MQTT) the node setTimeout will be used by default, thus the error you‘re getting. With window.setTimeout you‘re explicitly calling the TS implementation. Node and TypeScript can be very confusing haha. Closing this here for now, if you want to create a PR please do add the window. :). Thanks! Or do you need the window. to be in master regardless of a possible PR? |
Took me like 15 minutes to figure out you were not talking about a press release. :D |
Describe the bug
Source code produces a type error.
To Reproduce
npm run start
results in:Fix
Replace
setTimeout
withwindow.setTimeout
for the six instances mentioned above.The text was updated successfully, but these errors were encountered: