Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turf.js@5 breaks on Mobile Safari on iOS 9.x and 10 #1243

Closed
thesephist opened this issue Feb 1, 2018 · 14 comments
Closed

Turf.js@5 breaks on Mobile Safari on iOS 9.x and 10 #1243

thesephist opened this issue Feb 1, 2018 · 14 comments

Comments

@thesephist
Copy link

thesephist commented Feb 1, 2018

I 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.

@DenisCarriere
Copy link
Member

🤔 sounds like it might be a jsts issue, Object.defineProperties comes from the turf-jsts bundle:

https://cdn.jsdelivr.net/npm/turf-jsts@1.2.3/jsts.js

🤞 Next release (v6.0) we won't have jsts anymore and we will be using Martinez as a replacement.

@ath0mas
Copy link
Contributor

ath0mas commented Feb 5, 2018

@thesephist do you know from which version of Turf does it started to break with this error?

@thesephist
Copy link
Author

Turf version 3.9.0 works as expected; turf version 3.10.0 breaks, and as of turf 5.1.6 the issue is still present.

For sake of recordkeeping here's the corresponding issue on turf-jsts, which seems like the cause of the problem: DenisCarriere/turf-jsts#3

@karijkangas
Copy link

karijkangas commented Mar 3, 2018

Seeing this same issue with Turf 5.1.6, React Native 0.53, in both Android 8.0 emulator and Android 6.0 HW.

JavaScript:
import Turf from '@turf/turf';
Results to error:
E ReactNativeJS: Attempting to configurable attribute of unconfigurable property.

Modifying the code to use separate imports (e.g. import along from '@turf/along') works; at least for the modules I'm using :-)

Also, import Turf from '@turf/turf' works ok in iOS, both simulator and HW.

@TBruegg
Copy link

TBruegg commented Mar 13, 2018

I also encountered this error for PhantomJS. Unfortunately, I couldn't find a workaround so far. Has there already any release date been announced for the upcoming turf.js version 6.0?

@DenisCarriere
Copy link
Member

any release date been announced for the upcoming turf.js version 6.0?

At the moment, we're converting TurfJS to completely to Typescript, that way we don't have any CommonJS transpiling issues moving forward. (for more info #1240)

At the moment, there are many modules that have already been published under v6, however @turf/turf will be the last one to be published.

@TobiTobsen92 @karijkangas Is there a particular module you are working with? Noticing you are using @turf/along, I've just published that module to v6.0, try to see if it works with PhantomJS.

https://unpkg.com/@turf/along@6.0.0/

@karijkangas
Copy link

I'm currently using separate imports and it's working ok. I added my comment above just with the hope that it would be picked up by search engines as it would have helped me to save some time in troubleshooting.

@DenisCarriere
Copy link
Member

@karijkangas Thanks for the feedback! 👍

I'm glad to hear that separate imports do in fact work.

Once the code is ported over the Typescript, we "should" not have any issues with Mobile Safari 🤞

@TBruegg
Copy link

TBruegg commented Mar 23, 2018

@DenisCarriere I'm currently working with a range of modules, the particular functions which I'm using are lineIntersect, kinks, distance, lineString, convertLength and those related to great circle and rhumb line measurements/computations.

@tmcw
Copy link
Collaborator

tmcw commented Jun 25, 2018

Closing; #88 is the tracking issue for JSTS.

@tmcw tmcw closed this as completed Jun 25, 2018
@gusoskar
Copy link

gusoskar commented Nov 8, 2018

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.

@umairda
Copy link

umairda commented Dec 13, 2018

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

@anastely
Copy link

Any update?
I'm using version 5.1.6 with react native and I have this message
attempting to a configurable attribute of a configurable property in android

@tmcw
Copy link
Collaborator

tmcw commented Apr 27, 2019

Please consult my reply to this thread, dated June 24, 2018, above, which contains a link to the issue that deals with fixing this issue, #88. and has a recent reply six days ago about a potential fix for the issue.

@Turfjs Turfjs locked as off-topic and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants