Open totase opened 4 months ago
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.
const config = {
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?