#THREE local hosting PATH & HELP
38 messages · Page 1 of 1 (latest)
Uncaught SyntaxError: The requested module 'three' does not provide an export named 'Color' (at Water.js:2:2)
any instance of import { ... ] from 'three' you have to change to import { ... } from 'ralative/path/to/three.js'
The importmap doesn't do anything if you're using local files.
So i can remove importmap in HTML?
Yep.
Do a search in files for from 'three' and replace them all one-by-one with the relative path from that file to your three.js file.
This can be a laborious process so I really recommend you only download the extensions you really need.
three.module.js?
I did this
import * as THREE from '../APP_LIBS/build/three.module.js';
import { Water } from 'three/addons/objects/Water.js';
import { Sky } from 'three/addons/objects/Sky.js';
import { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
import { MTLLoader } from 'three/addons/loaders/MTLLoader.js';
GET http://localhost/APP_LIBS/three.module.js net::ERR_ABORTED 404 (Not Found)
It should work right
I have no idea what you're doing there.
import * as THREE from ' path threejs '
Like, that error code and screenshot makes no sense to me.
Wherever you're using the THREE object
Like before you use new THREE.Vector3(0, 0, 0) for example
Yeah
Or you can just write import { Vector3 } from 'relative/path/to/three.js
But I'm really not sure what you're doing with that sock var or using HTTP requests.
I just want to import the JSM where the examples, objects ect are in build i have three file
Before i did this wait
That's what i use
But i want to host it local
OK i fixed it
Thanks this helped
You also need to have Three on your HTML page. idk if you did that
What's the poaint of putting the script in a div?
The script isn't a rendered object
I know
It can just as easily go in the <head> section