react-use: Typescript 4.1.2 fails with "Cannot find name 'PositionError'"
What is the current behavior? I’ve got an error
node_modules/react-use/lib/useGeolocation.d.ts(11,21): error TS2304: Cannot find name 'PositionError'.
react-use: 15.3.4 typescript: 4.1.2
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 20
- Comments: 16 (9 by maintainers)
Commits related to this issue
- fix: #1646 make own interface that compatible with GeolocationPositionError and PositionError. It is the easiest way to avoid errors in typescript 4.1 — committed to streamich/react-use by xobotyi 3 years ago
- Merge pull request #1738 from streamich/fix-1646 fix: #1646 — committed to streamich/react-use by xobotyi 3 years ago
- chore(release): 15.3.7 [skip ci] ## [15.3.7](https://github.com/streamich/react-use/compare/v15.3.6...v15.3.7) (2021-01-08) ### Bug Fixes * [#1646](https://github.com/streamich/react-use/issues/164... — committed to streamich/react-use by semantic-release-bot 3 years ago
- fix: #1646 make own interface that compatible with GeolocationPositionError and PositionError. It is the easiest way to avoid errors in typescript 4.1 — committed to eaglus/react-use by xobotyi 3 years ago
- chore(release): 15.3.7 [skip ci] ## [15.3.7](https://github.com/streamich/react-use/compare/v15.3.6...v15.3.7) (2021-01-08) ### Bug Fixes * [#1646](https://github.com/streamich/react-use/issues/164... — committed to eaglus/react-use by semantic-release-bot 3 years ago
- fix: #1646 make own interface that compatible with GeolocationPositionError and PositionError. It is the easiest way to avoid errors in typescript 4.1 — committed to kamranayub/react-use by xobotyi 3 years ago
- chore(release): 15.3.7 [skip ci] ## [15.3.7](https://github.com/streamich/react-use/compare/v15.3.6...v15.3.7) (2021-01-08) ### Bug Fixes * [#1646](https://github.com/streamich/react-use/issues/164... — committed to kamranayub/react-use by semantic-release-bot 3 years ago
solved the problem by adding in global.d.ts
type PositionError = GeolocationPositionError;🎉 This issue has been resolved in version 15.3.7 🎉
The release is available on:
Your semantic-release bot 📦🚀
It seems like
PositionErrorwas changed toGeolocationPositionErrorin this version of Typescript.@dovidweisz made a bit overkill the easiest way is to introduce own interface compatible with
GeolocationPositionErrorI agree 👍
@dovidweisz typesVersions could help here?