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.

RBush is not a constructor

See original GitHub issue

Sample Code

https://codesandbox.io/s/turf-convex-error-h9pe5

import { point, featureCollection } from "@turf/helpers";
import convex from "@turf/convex";

// data from https://turfjs.org/docs/#convex
const points = featureCollection([
  point([10.195312, 43.755225]),
  point([10.404052, 43.8424511]),
  point([10.579833, 43.659924]),
  point([10.360107, 43.516688]),
  point([10.14038, 43.588348]),
  point([10.195312, 43.755225])
]);

const hull = convex(points); // This line generates error

image

Details

Turf Version: 6.5.0

Please provide the following when reporting an issue:

  • The version of Turf you are using, and any other relevant versions.
  • GeoJSON data as a gist file or geojson.io (filename extension must be .geojson).
  • Snippet of source code or for complex examples use jsfiddle.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

5reactions
catnukocommented, Apr 1, 2022
alias: {
    "rbush": __dirname + "/node_modules/rbush/rbush.js"
},
2reactions
JamesLMilnercommented, Nov 23, 2021

I think I can work out the rbush bundling issues with collect and unkink (and in turn turf modules that rely on them such as lineSlice) but fixing convex is complicated. We’d either need to get concaveman to use the ES5 version of rbush or to publish a compiled ES5 version. The other potential option is to maintain our own version of concaveman but I’d really rather avoid that if possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack imported module is not a constructor - Stack Overflow
I created a small JS module which I intend to make an npm package, but for now is just on GitHub. This module...
Read more >
rbush - npm
RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. It's based on an optimized R-tree data ...
Read more >
rbush is not a constructor_多比熊的博客
今天使用webpack打包代码后启动时报了一个奇怪的错误,rbush不是一个构造函数幸运的是在github中有人遇到了类似的错误 RBush is not a constructor
Read more >
@turf/convex examples - CodeSandbox
Turf Convex Error (forked)Error "RBush is not a constructor" · JamesLMilner · 3pojf · changqingom · 6xyb7 · Turf Convex Error (forked)Error "RBush...
Read more >
RBush 3.1.0 - NuGet
An optional argument ( maxEntries ) to the constructor defines the maximum number of ... If the item being passed in is not...
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