-
Notifications
You must be signed in to change notification settings - Fork 2k
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
poly-decomp currently not working with browserify #365
Comments
I managed to remove the first issue by installing
but now matter-js complains that poly-decomp doesn't exist. (this is what happened earlier before I added it to the I'm not entirely sure how this works though - I see I tried modifying Bodies.js to take decomp as a parameter, but that didn't work either for some reason. |
I'm using browserify-shim to make the require work. It seems to output this line: var decomp = (typeof window !== "undefined" ? window['decomp'] : typeof global !== "undefined" ? global['decomp'] : null); Looking at it, I'm not sure how it's actually meant to work in an environment where global.decomp = require('poly-decomp'); |
Let me know if I'm wrong on this, but I think
poly-decomp
isn't working.I installed the module using
npm install --save poly-decomp
.After that didn't work, I tried to globalise a
decomp
variable by doing this:Since I want to use the same code base for my client and server, I needed to create a window object to use when it doesn't exist. Since I'm checking if
window
exists already, I think this should work.The error I receive is:
decomp.Polygon is not a constructor
The text was updated successfully, but these errors were encountered: