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.

ion-range: Type 'string' is not assignable to type 'number'.

See original GitHub issue

Bug Report

There seems to be an issue with parsing numeric input to ion-range component.

Ionic version:@ionic/core”: “^4.0.0”

Current behavior:

[ ERROR ]  TypeScript: src/components/predictors/uis/pepkalc/app-pepkalc.tsx:57:35
           Type 'string' is not assignable to type 'number'.

     L56:  <ion-item>
     L57:    <ion-range pin min="0" max="400" color="primary">
     L58:      <ion-label slot="start">0K</ion-label>

Expected behavior: The range slider works and parses number arguments.

Steps to reproduce:

                  <ion-item>
                    <ion-range pin min="0" max="400" color="primary">
                      <ion-label slot="start">0K</ion-label>
                      <ion-label slot="end">400K</ion-label>
                    </ion-range>
                  </ion-item>

Because of the above the compilation process stops and reports an error.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ktamiolacommented, May 14, 2019

🤦‍♂️ Thank you so much @brandyscarney . How embarrassing… All works like a charm now.

0reactions
ionitron-bot[bot]commented, Jun 13, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-range: Type 'string' is not assignable to type 'number'.
There seems to be an issue with parsing numeric input to ion-range component. Ionic version: "@ionic/core": "^4.0.0". Current behavior:.
Read more >
Type 'string' is not assignable to type 'number' - Stack Overflow
toFixed returns a string which you are assigning to a variable which should be number . You need another pair of () to...
Read more >
type 'string' is not assignable to type 'number'.ts
In this tutorial, we will see how to fix error type 'string' is not assignable to type 'number'.ts and also how to fix...
Read more >
Type 'string' is not assignable to type 'any[]' - Ionic Forum
Hey everyone. One Problem and I don't know what to do :frowning: I had search a while but don't find solution: This is...
Read more >
Error ts2322 type 'string' is not assignable to type 'number' In ...
Hello Friends,Today our topic is on error ts2322 type ' string' is not assignable to type ' number ' in typescript.Basically, this is...
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