Comments (4)
Supercluster is set up properly and unambiguously as a ESM package. If you have unexpected issues when using it in Next.js with Jest and TypeScript, perhaps it's worth reporting the issue in the respective projects.
It looks like the "exports" property in package.json blocks the files in dist/ from being used, which includes the default "main" entry.
I would recommend changing the exports package.json property to include the dist/ directory.
exports
is intentionally configured to point to index.js
, the ES module entry. Builds in dist
are legacy browser builds that aren't supposed to be used in a bundler configuration. exports
field takes precedence over main
so it doesn't matter if the latter is present or what it specifies (it's a leftover for legacy Node versions) — see the docs.
The ESM output file should use .mjs, the commonJS output file should use .cjs.
Not if the package.json
has type: "module"
specified, in which case all .js
files are treated as ESM.
I think that should correctly configure the project to default to CommonJS unless ESM is specifically requested by the importer.
This project is ESM only. CommonJS support was intentionally dropped in v8.0.0, and is no longer available.
from supercluster.
Experience this same error also
from supercluster.
This happen when using
babel-jest: "29.6.4"
jest: "29.5.0"
and upgrade supercluster to version 8.0.0
The babel-jest and jest version is alright if we use supercluster 7.1.5
from supercluster.
I managed to resolve this issue by adding supercluster and kdbush in transformIgnorePatterns at jest.config.js
Hope it helps!
from supercluster.
Related Issues (20)
- Cluster marker changing randomly HOT 1
- Caching SuperCluster Index HOT 4
- supercluster__WEBPACK_IMPORTED_MODULE_4__ is not a constructor HOT 1
- No cluster with the specified id thrown (originId is too high) HOT 4
- Performance: store internal data in flat numeric arrays HOT 1
- Unpexpected numItems value: 0. at new KDBush HOT 2
- Supercluster cause an error in the unit test HOT 1
- do you have a java version of the latest code HOT 2
- Maplibre-GL-JS Example? HOT 2
- NodeLink map visualization HOT 1
- getLeaves and getChildren throw "Cannot read properties of undefined (reading 'length')" HOT 1
- Missing points when bounds are scoped to the extent of points
- Not support type script (Nestjs) HOT 2
- Right way to use supercluster with dynamic data HOT 5
- Dynamic filtering of data without reinitializing cluster HOT 1
- Not Compatable with NestJS HOT 2
- Question: does clusterRadius value represent miles, meters, yards, etc? HOT 2
- Question: How do I cluster specific markers
- The clustering behavior is strange when the zoom level is above 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supercluster.