You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
but now matter-js complains that poly-decomp doesn't exist. (this is what happened earlier before I added it to the window object, however the updated version of matter-js no longer checks window)
I'm not entirely sure how this works though - I see require('poly-decomp') at the beginning of Bodies.js, so I would figure either it would work or the require would have thrown the error instead.
I tried modifying Bodies.js to take decomp as a parameter, but that didn't work either for some reason.
Looking at it, I'm not sure how it's actually meant to work in an environment where require is available... doh. I was expecting it to have a check for require before looking for globals. I'll need to look into it, but maybe you could try this for now at your code entry point:
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: