I was checking my portfolio, which was working fine a few weeks ago, and i found out that my three.js model isn't showing anymore (I haven't modified anything since it was working fine.), and when I checked the errors in the console, it gave me this error: Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../"..
I was importing three.js in a main.js file like this:
import * as THREE from 'https://cdn.skypack.dev/three', so I changed the import to: import * as THREE from '../node_modules/three/build/three.js', but now it returns an error of 404. what should I do?
This is my file structure:
The proper way to install three.js is described here:
https://threejs.org/docs/#manual/en/introduction/Installation
should be like so:
import * as THREE from 'three';