Closed RainBoltz closed 2 years ago
Hi @RainBoltz,
Thanks for your report. In the package.json of v-network-graph, the specification scheme "Subpath exports" is used. This does not seem to work well in some environments.
In the future, I may revise this way of specifying, but for now, please try the following:
import { ForceLayout } from "v-network-graph/lib/force-layout.es"
Best regards,
Hi @dash14,
Thanks for the fast reply!
When I use the code:
import { ForceLayout } from "v-network-graph/lib/force-layout.es"
here comes another error:
Cannot find module 'v-network-graph/lib/force-layout.es' or its corresponding type declarations.ts(2307)
(I'm using Node14 + npm6 on MacBook)
can you provide any environment setting that can run the example successfully? that would be helpful!
Hi @RainBoltz,
Sorry for the late reply. I was using Vite myself and had no problems, so I was not aware of the seriousness of this issue. I created a new environment with vue-cli and was able to reproduce the error you reported, even with an alternative import statement. Then, I have fundamentally reworked the configuration for importing, so please check using the new version. (v0.3.15)
Please import force-layout as follows:
import { ForceLayout } from "v-network-graph/lib/force-layout"
Hi @dash14 , Thx for the hotfix, really appreciate that! 💯 (btw @RainBoltz is not my twitter account lol)
Hi, really appreciate your amazing work!
I'm using Vue3 with Typescript and I can't reproduce this example about d3-force.
anyway, VSCode didn't show any error after importing
v-network-graph/force-layout
(the interface is reachable I guess), but the compilation failed when I runnpm run serve
.here's the full error message:
thanks for reviewing this problem!