Svgloader can not load in build mode

const loader = new SVGLoader();
loader.load("propeller.svg",function(data){
    data.paths.map((shp) => shapes.push({shape:SVGLoader.createShapes(shp)[0],color:shp.color }))
})

I have this code and it runs well in dev. but when I deploy the app, it fails to load the svg and warns “invalid url”. works perfectly well in development mode. can anyone help?

Have you confirmed that the full URL of the requested SVG file points to an existing file?

Problem solved. Thank you very much. The document was not loaded at the time of rendering, that is why. I had to use usestate to store the data and then use it.