Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versor dependency prevents some toolchains (vite) #23

Open
18kimn opened this issue Sep 16, 2021 · 0 comments
Open

Versor dependency prevents some toolchains (vite) #23

18kimn opened this issue Sep 16, 2021 · 0 comments

Comments

@18kimn
Copy link

18kimn commented Sep 16, 2021

d3-inertia currently depends on versor ^0.1, which results in a download of versor 0.1.2. However, that version of versor incorrectly specifies its package.json file, by specifying module and jsnext:main as src/versor.js. No such file exists for that version; they should be pointing instead towards src/index.js (or instead src/index.js should have been src/versor.js).

This actually does not matter for many cases, since d3-inertia's usage of versor under the hood uses the bundled versions in the dist folder. However, some toolchains like Vite need this field to be correctly specified to avoid unnecessary bundling. Vite gives the following error when trying to run yarn start:

node_modules/vite/dist/node/chunks/dep-63d4bd14.js:43786:10: error: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "versor". The package may have incorrect main/module/exports specified in its package.json:

I thought it would be as simple as requiring d3-inertia to use versor 0.2.0, but this did not work when I tried it out because versor 0.2.0 has type: module in its package.json and thus the require statement in d3-inertia's minified file fails. So I'm not sure what the best solution is.

If this issue occurs for anyone else, a temp fix for d3-inertia users is to use patch-package after just renaming versor 0.1.2's src/index.js to src/versor.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant