-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pure HTML + JS - Uncaught ReferenceError: three is not defined #261
Comments
See https://threejs.org/docs/#manual/en/introduction/Installation and usage of import maps in Compatibility section. |
This example show a workaround when using a cdn https://glitch.com/edit/#!/three-import-map?path=index.html. |
Didn't work - tried different setups with the example above but none worked. The head in my HTML file looks like this:
The body tag on the same HTML is as following:
The API key variable is loaded from another JS file just fine, so please ignore it. In the console I still see the same error and also for some reason initializeJourneySharing cannot be found (it is defined inside the shipment_tracking.js which is loaded as a module). But this is another error, I believe the initial problem is still there.
|
either way, I recommend using a proper build tool or using only esm modules and avoiding the pattern you are using here |
right after you load three.js, add |
### [2.0.1](v2.0.0...v2.0.1) (2022-02-07) ### Documentation * **README:** add note about three not defined ([fe65dd6](fe65dd6)), closes [#261](#261)
🎉 This issue has been resolved in version 2.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Hi,
I'm trying to modify a shipment tracking demo app that uses WebGL maps to use ThreeJS.
I'm purely using HTML + JS, no frameworks.
In my HTML code I have after before :
When I load the HTML page, in Chrome dev tool's console, I see this error coming from the second javascript file listed above:
If I also check the Network tab I see that three.min.js is loaded before index.min.js so it should've loaded three.min.js which seems to be a dependency in index.min.js.
I tried using a local version of three-js but also before that I tried using a CDN hosted version but nothing worked. I'm using r136 which is the same one that you have in the examples on https://github.com/googlemaps/js-three.
I'm running this on MacOS, starting my local webserver with gradlew appengineRun which will just create a local server.
Can you provide a pure HTML + JS sample code that would work?
Thanks!
The text was updated successfully, but these errors were encountered: