pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.27k stars 682 forks source link

Drei rejected because of mime type ("") #1922

Closed TheLogan closed 5 months ago

TheLogan commented 5 months ago

Problem description:

First of all, I don't know if I should report this here or in Vite's github page, but since all my other libraries are working, I figured I'd post here first. This is a fairly new project, created to test three.js and play around a bit. three.js worked fine, but then I added drei in order to load models, and I got this error Loading module from “http://localhost:5173/node_modules/.vite/deps/@react-three_drei.js?v=79a151a3” was blocked because of a disallowed MIME type (“”). At the same time I could see that the request for the file was getting the following error 504 Outdated Optimize Dep After a bit of digging I noticed that in .vite/deps there was a @react-three_drei.js.map file, but no .js file.

Suggested solution:

I am afraid that I don't have a solution, something between drei and vite is clearly not working correctly on my machine. :/ I tried deleting the deps folder a few times, with a few different settings changes for vite regarding drei, but couldn't find anything that worked, and none of co-pilote's suggestions worked either xD

TheLogan commented 5 months ago

I gave up getting it to work yesterday, and today it works, I have no idea why. The only thing I can see has changed is that I went from @react-three/fiber 8.16.1 to 8.16.2, but I don't think that should change drei not being prepared by vite properly