You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use react-sigma with vite, but when I run tests I get the following error in the console and the tests fail:
Error: Cannot find module '*/node_modules/graphology-layout-forceatlas2/worker' imported from */node_modules/@react-sigma/layout-forceatlas2/lib/react-sigma_layout-forceatlas2.esm.min.js
Did you mean to import graphology-layout-forceatlas2/worker.js?
Note that the application runs as expected, and I have no issue building the project. See list of dependencies below:
If I navigate to the module package it complains about (*/node_modules/@react-sigma/layout-forceatlas2/lib/react-sigma_layout-forceatlas2.esm.min.js) and manually change the import from import e from"graphology-layout-forceatlas2/worker"; to import e from"graphology-layout-forceatlas2/worker.js";, the tests run as expected. Is there any way to fix this within the package?
The text was updated successfully, but these errors were encountered:
I'm not sure it's an issue with the package, due to the fact that you need to add the extension.
What version of graphology-layout-forceatlas2 do you use ?
Can you share your vite config file ?
Unsure of vite's config, but I'm using webpack and I was able to get around this by using an alias e.g.
constconfig={resolve: {alias: {'graphology-layout-forceatlas2/worker': 'graphology-layout-forceatlas2/worker.js',// added this here},},// ...rest of config}
I use
react-sigma
withvite
, but when I run tests I get the following error in the console and the tests fail:Note that the application runs as expected, and I have no issue building the project. See list of dependencies below:
Operating System: Ubuntu 20.04.6 LTS
If I navigate to the module package it complains about (
*/node_modules/@react-sigma/layout-forceatlas2/lib/react-sigma_layout-forceatlas2.esm.min.js
) and manually change the import fromimport e from"graphology-layout-forceatlas2/worker";
toimport e from"graphology-layout-forceatlas2/worker.js";
, the tests run as expected. Is there any way to fix this within the package?The text was updated successfully, but these errors were encountered: