question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type Timer not assignable to type Number

See original GitHub issue

After recently starting a new project with Bobril (within the last 30 minutes), I am getting the the above error against this line of code:

https://github.com/Bobris/Bobril/blob/7bce04dda6afb570b1a57afc6fe905b00fe607fb/package/index.ts#L4233

After fishing around for a bit, waitingForPopHashChange is a numeric where setTimeout is a timer. Is this a legit error or something perhaps I messed up when installing the project?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Bobriscommented, Aug 20, 2017

Typescript compiler when not defined loads automaticaly all @types, luckily you can prevent it by adding this section to your package.json:

"bobril": {
    "compilerOptions": {
        "types": []
    }
},

It will define to Typescript compiler that it should load only specified type modules - and you don’t need any.

1reaction
Bobriscommented, Aug 20, 2017

Reproduced, give me some time to debug …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript Error: setInterval - Type 'Timer' is not assignable to ...
Basically you are trying to cast type number variable to a timer one. could you do instead ? let onSizeChangeSetInterval:NodeJS.
Read more >
setInterval - Type 'Timer' is not assignable to type 'number ...
I am attempting to create an interval for a web app. But in the browser, setInterval() returns a number representing the ID of...
Read more >
TypeScript incorrect error: Assigned expression type number ...
TypeScript incorrect error: Assigned expression type number is not assignable to type NodeJS.Timer · 1. Setup project with WebStorm and TypeScript · 2....
Read more >
Typescript Error: setInterval – Type 'Timer' is not assignable to ...
I have the following code: let onSizeChangeSetInterval = setInterval(() => {...}, 30);. When I compile this code, I'm getting the following error:.
Read more >
Microsoft/TypeScript - Gitter
Compiler is still saying : error TS2322: Type 'Timer' is not assignable to type 'number'. Plus you gave me same chunk of code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found