Giter Club home page Giter Club logo

Comments (4)

mourner avatar mourner commented on June 8, 2024

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.

riorafe avatar riorafe commented on June 8, 2024

Experience this same error also

from supercluster.

riorafe avatar riorafe commented on June 8, 2024

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.

riorafe avatar riorafe commented on June 8, 2024

I managed to resolve this issue by adding supercluster and kdbush in transformIgnorePatterns at jest.config.js
image

Hope it helps!

from supercluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.