-
Notifications
You must be signed in to change notification settings - Fork 147
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
THREE is not defined #188
Comments
Same problem occurs when using VUE. I would assume this is the same for anything using Webpack. Is there any movement on a resolution? |
Same here with webpack. |
+1 with webpack. When building videojs-vr, I get: (!) Unresolved dependencies |
For webpack work solution:
in webpack config |
resolve: {
alias: {
'videojs-vr': __dirname + '/node_modules/videojs-vr/dist/videojs-vr.min.js'
}
} This is not working for me in webpack.config.js and vue.config.js. Please, who has set this up in a Vue App? @sh84 @luiscerqueira |
I ended up doing |
It would seem the underlying issue here is with the rollup-replace.js script which transforms the three.js example files to add an Not only that, but I see this as a major issue when it comes to semver. Three.js could at any point change their examples in a patch version as they are just that, examples. This could result in breaking changes in patch or minor releases. While the current approach is "clever" as a way to reduce boilerplate in this repo, the old solution of copying the examples into this repo is the correct solution. |
I'm using
and experiencing the same problem with THREE not being defined, but I'm puzzled because seeing the different comments, I'm not sure how to solve it really. I know I'm asking for a specific case, but maybe if someone can point out some hints that could help someone else. |
@hgshoggins The solution my company had to resort to was locking down videojs-vr to version 1.4.1. Hopefully that works for you! |
This seems like a pretty serious issue with no workaround. Is this being prioritized to be fixed? |
Hi Has anyone solved this yet? |
@Brandonza, looks like nobody here really gives a crap... |
is there any solid solution ? |
Not as far as I know |
Do you find a solution ? I've seen something with rollup-replace.js which could fix the problem (maybe) but I don't understand how implemented this in a vue.js app. Thanks for your help |
I saw a couple of answers, here is what worked for me on
That should do the trick |
Doesn't work for me, when I dont call require("videojs-vr") it can't find the vr(..) method.
|
Did you import THREE seperately? |
Description
Briefly describe the issue.
When trying to use the videojs-vr plugin in a react app, the app crashes.
Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
Results
Expected
Video and VR functionality should be working
Actual
React webpack Unhandled Rejection is thrown, saying that THREE is not defined
Error output
Uncaught (in promise) ReferenceError: THREE is not defined
at Object.../node_modules/three/examples/js/controls/VRControls.js (VRControls.js:5)
at webpack_require (bootstrap:790)
at fn (bootstrap:150)
at Module.../node_modules/videojs-vr/dist/videojs-vr.es.js (videojs-vr.es.js:1)
at webpack_require (bootstrap:790)
at fn (bootstrap:150)
Additional Information
The Three.js examples has the assumption that the THREE object is defined globaly. For some reason, this is not the case when the webpack is used.
versions
videojs
v.7.5.5
browsers
Chrome
OSes
Windows
plugins
The text was updated successfully, but these errors were encountered: