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
Somewhere in your dependency tree is a package that works in both Node and the browser. When used in Node, it probably supports some Node types like Buffer, and so it brings in @types/node to express that relationship, which causes Node globals to become available, and Node has a setTimeout with a different definition than the browser one.
As a workaround, you can use window.setTimeout which will only have the browser definition.
I think the best solution to this is to move forward with #31894 and then change typings of all packages that optionally use Node to support them, but that's a ways off.
TypeScript Version: 3.4.5
Search Terms: setTimeout
Code
Expected behavior:
It compiles correctly
Actual behavior:
Playground Link:
Not reproducable in playground
Related Issues:
Possibly #19635, but this issue seems to be outdated because now the declaration of setTimeout looks like:
https://stackoverflow.com/q/45802988
The text was updated successfully, but these errors were encountered: