Reputation: 660
I am on vite / vue 3 typescript and tried to import SVG via three.js but following error pops up as soon as I import the SVGLoader
http://localhost:3000/node_modules/.vite/deps/three_examples_jsm_loaders_SVGLoader.js?v=96b3206a net::ERR_ABORTED 504 (Gateway Timeout)
import { SVGLoader } from "three/examples/jsm/loaders/SVGLoader";
Any idea whats causing the gateaway error?
Upvotes: 0
Views: 1020
Reputation: 4005
It seems like a Vite bug with module(package) import, according to this github discusstion; and I know for sure because I've come across similar kind of problem when using any kind of unpolished module packages in Vite.
Fortunately, SVGLoader
itself is not dependent to any other packages except three.js, so I advise you to copy the SVGLoader code and make it as your own .ts
file to include in your project.
Upvotes: 1