Rank 3: Container
i need to use http-server brb
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 3: Container
i need to use http-server brb
Rank 3: Container
okay here
Rank 3: Container
yeah theres
Rank 3: Container
no import issues here
Rank 3: Container
just the cors stuff
Rank 3: Container
but nothing about importing stuff
Rank 3: Container
actually one of the textes inside these imported scripts is working on the page
Rank 3: Container
so it means that they've been correctly imported into the app.jsx file
Interesting...so maybe it is a netlify problem lol
Rank 3: Container
THEY JUST CENSORED MY POST 💀
Rank 3: Container
now im getting this
Rank 3: Container
es:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
then this
index-xNIsFJLs.js:63 Error loading module: TypeError: Failed to fetch dynamically imported module: https://wopen.netlify.app/assets/langs/es
Rank 3: Container
i found how the build encrypts the js main script where it imports the dynamic module
var t = vg(()=>import("./langs/" + e), __vite__mapDeps([]));and im not sure on what to think
Rank 3: Container
it seems to be all good
Rank 3: Container
like you can see the file is clearly not even changing its path after the build
Rank 3: Container
im actually lost here
Rank 3: Container
ill try pushing all the langs scripts into the src folder
Rank 3: Container
so i fixed it by changing
export const datato
export { data }Rank 3: Container
and the import module looks like this
let dataModule = import(`./langs/_${userLanguage}.js`);Rank 3: Container
i also changed scripts name with an underscore before their names
Rank 3: Container
but thats optional
Rank 3: Container
apparently it had to do with the way i was writing the overload
Rank 3: Container
instead of doing './langs/' + userLanguage
Rank 3: Container
you do `./langs/${userLanguage}`
Rank 3: Container
[SOLVED] Netlify moving dynamic imports into /public/assets/ folder