Turf.js@5 breaks on Mobile Safari on iOS 9.x and 10
See original GitHub issueI have reproduced this with the full, CDN-served build of turfjs. An easy way to see this is to navigate to turf’s docs site on an iOS 9.x or 10 device. Turf examples do not work as expected, and when inspected over a Mac, mobile Safari gives the error: Attempting to change configurable attribute of unconfigurable property.
I was not able to narrow this down to a single turf module yet, but bboxPolygon
is a potential candidate, judging from neighboring code in the minified build. The error occurs at 1:248611
with the CDN build for turf@5. Seems to be caused by an Object.defineProperties
to override the name
prop on the global Error
class.
Seems to work on all other modern browsers by my testing.
EDIT: the exact build I’m using was downloaded from https://cdn.jsdelivr.net/npm/@turf/turf@5/turf.min.js
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (4 by maintainers)
Using Turf 5.1.6, React Native 0.56.1.
Getting ‘Attempting to change configurable attribute of unconfigurable property.’ when running my project on Android. Tried using import tuf from ‘@turf/turf’ as @karijkangas suggested, but it still gave me the same error. This workes on iOS however.
I was getting the same build error on Android with RN 0.56.1
@gusoskar Check which specific module you are using from turf and see if a 6.0 version is available. For example I needed bbox so I installed @turf/bbox@latest => installs 6.0.1
That fixed my issue.
As @DenisCarriere mentioned they are porting the library over to Typescript (6.0) to avoid these transpiling errors