bbox-polygon v6.0.0 - helpers_1.polygon is not a function
See original GitHub issueI just installed @turf/bbox-polygon
and got v6.0.0. However upon using it I get the following error:
TypeError: helpers_1.polygon is not a function
bboxPolygon
node_modules/@turf/bbox-polygon/index.js:36
33 | var topLeft = [west, north];
34 | var topRight = [east, north];
35 | var lowRight = [east, south];
> 36 | return helpers_1.polygon([[
37 | lowLeft,
38 | lowRight,
39 | topRight,
addLayers/<
src/components/Map.js:158
> 158 | const bboxData = bboxPolygon([
159 | layer.bounds.west, layer.bounds.south,
160 | layer.bounds.east, layer.bounds.north
161 | ])
If I switch to v5.1.5 there’s no issue.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Advanced geospatial analysis - Turf.js
Takes two (Multi)Polygon(s) and returns a combined polygon. If the input polygons are not contiguous, this function returns a MultiPolygon feature. Arguments ...
Read more >Uncaught TypeError: o.intersection is not a function in turf.js
I think turf.intersect() takes only single features with Polygon geometry as arguments. You should separate your layers into individual ...
Read more >Javascript error when determining if a point falls within a ...
Using Google Maps API v3. Here is the JS: function drawPolygon() { var polygon = new google.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My bad: I also had the entire
@turf/turf
installed as a dependency, probably causing a conflict. Removing that in favour of the specific packages I need, and there’s no issue. Thanks, and great work on v6.0.0 👍@alpha-beta-soup Seems to work on my side, must be something with your build.
Can you provide your build setup and a sample code of how you are using the module.
The following works for me:
install
CommonJS - test.js
Typescript - test.ts
Going to close the issue unless there’s more information provided by @alpha-beta-soup