#Converting project from cdn links to installing with npm
21 messages · Page 1 of 1 (latest)
yes, I didn't see the error on mobile, just answered the imports
you shouldn't import directly from node_modules
are you using vite?
nope, it doesn't
live server is jus a web server
vite is also a bundler
ie. it'll resolve paths for you
(vite - additionally to that bundling functionality - can serve as a live server)
there's essentially no difference between:
import { OrbitControls } from "../node_modules/three/examples/jsm/controls/OrbitControls.js";
and:
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
as long as node_modules is in the same directory as the rest of the code
so it's unlikely that difference is caused by this change
maybe you accidentally updated three to version >154 when installing vite
and since there were significant color changes between three 151 and 152, they might have changed the look of your scene
yup
The upcoming release r152 will contain changes affecting color and lighting. These updates enable a “linear workflow” by default, for better image quality in both physically-based and non-physically-based scenes. By “linear workflow”, we mean that any sRGB input colors (as found in most textures, color pickers, CSS, and HTML) are converted from ...
nope, you can to run it only when installing new packages
no, if you edit the package then you have to npm install
I thought you meant just project files, not package.json
if you edit package - npm install
if you edit just the code in your project - no need to npm install
Without code snippets it will be pointless. There has to be a bug somewhere. Overall, live server is something that was used in the 90s, you don’t use that any longer and it’s a terrible way to make apps (live refreshing the whole page on every change). If I was you I’d stick to weiss what you have right now and isolate the issue.