Relative references must start with either "/", "./", or "../".
TypeError: Failed to resolve module specifier "three".
for reproduction this error https://geni.us/N1WaESO
While using Three.js with p5.js, I suddenly encountered the error: “Failed to resolve module specifier 'three'.” At first glance, it seems like a mistake in the module path (e.g., not using “./” or “../”), but the actual cause was a version mismatch in Three.js. Since version r118, Three.js has transitioned to ESM (ECMAScript Modules), and modules under examples/jsm/ have become tightly coupled with the core version. As a result, loading the latest version via CDN without version locking often breaks dependencies and causes runtime errors. In this case, explicitly specifying r128 resolved the issue. It's a classic example where the error message misleads from the true root cause. On the other hand, the error “Relative references must start with either '/', './', or '../'” is a separate issue caused by the p5.js Web Editor's virtual file system, which doesn't support relative ES module paths. Using a full CDN URL resolves this.