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.

@turf/helpers: Breaking change in 6.2.0 versus 6.1.4: coordinates must contain numbers

See original GitHub issue

6.2.0 reintroduces proper null-checking for points. Invalid usage of point throws errors where it had not in the past. If you found this issue by googling the error; double check that you’re passing in your coordinates as longitude, latitude – not latitude, longitude and check your usage carefully.

Error: coordinates must contain numbers
    at point (/Users/jeff/repos/find-nearest-us-cities/node_modules/@turf/helpers/dist/js/index.js:177:15)
    at /Users/jeff/repos/find-nearest-us-cities/index.js:17:25
    at Array.map (<anonymous>)
    at nearestCities (/Users/jeff/repos/find-nearest-us-cities/index.js:16:90)
    at Test.<anonymous> (/Users/jeff/repos/find-nearest-us-cities/test.js:12:24)
    at Test.bound [as _cb] (/Users/jeff/repos/find-nearest-us-cities/node_modules/tape/lib/test.js:90:32)
    at Test.run (/Users/jeff/repos/find-nearest-us-cities/node_modules/tape/lib/test.js:107:31)
    at Test.bound [as run] (/Users/jeff/repos/find-nearest-us-cities/node_modules/tape/lib/test.js:90:32)
    at Test._end (/Users/jeff/repos/find-nearest-us-cities/node_modules/tape/lib/test.js:201:11)
    at Test.bound [as _end] (/Users/jeff/repos/find-nearest-us-cities/node_modules/tape/lib/test.js:90:32)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jmealocommented, Jan 18, 2021

@mfedderly: 🤦 Thank you so much, I’d love to buy you a beer/pizza. geokdbush.around already returns an ordered set. I changed the title of the ticket to help others out in the future. My correctness tests were passing and I conflated #1977 to mean that there was an issue with the check. Sorry that I filed this upstream too hastily; I thought my parameter checking and test coverage was sufficient.

0reactions
mfedderlycommented, Jan 18, 2021

Oops, good call. The line numbers are for https://github.com/jmealo/find-nearest-us-cities/blob/master/index.js not test.js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@turf/helpers - npm
Start using @turf/helpers in your project by running `npm i ... coordinates Array<number> longitude, latitude position (each in decimal ...
Read more >
Advanced geospatial analysis - Turf.js
Calculates the distance between two points in degrees, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature.
Read more >
@turf/point-on-feature | Yarn - Package Manager
Most Turf functions work with GeoJSON features. These are pieces of data that represent a collection of properties (ie: population, elevation, zipcode, etc.) ......
Read more >
Receiving a 'coordinates must be an array of two or more ...
I have an array of coordinate arrays as shown in Turf.js (lineString) but I'm receiving this error: Uncaught Error: coordinates must be an ......
Read more >
Solved: Cannot modify a property of a sealed object: turf
isNumber(r[1]))throw new Error("coordinates must contain numbers");return ... new Error("Each LinearRing of a Polygon must have 4 or more Positions.
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