-
Notifications
You must be signed in to change notification settings - Fork 242
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
Using planck in a webworker #160
Comments
Might be related to this: webpack/webpack#6525 |
Just to be clear, I was talking about the webpack code embeded in planck.js. So I edited line 34 of the planck.js file. Patching the library will do for me for now. It's great to have box2d on javascript by the way :) |
If I understand, this would be a solution where I am to use webpack. I'm not using webpack. So if I do understand, some webpack code is added to planck.js to make it better for those who use webpack ? I only used 2-3 libraries up to now and it's the first one I see with embeded webpack code. (I'm new to js) |
Webpack combines source files and generates files like |
Oh, what I meant by asking if that solution works for you was that if rebuilding planck with that solution will solve the problem. I did not mean to use that solution in your project. |
Sorry, I don't want to learn how to build a js library at this time. If you want to reproduce the problem, you only have to call a worker with |
Makes sense, no worries; if you need to build it for any other reason here are the commands (assuming git and npm are already installed):
|
I don't know anything about webpack but it seams to be blocking planck from loading into a web worker. There is an access to the window element, which is not defined in a worker, and it really seams to be webpack related.
So I replaced the "window" reference to "this" and it works, but I really don't know what I'm doing!
The text was updated successfully, but these errors were encountered: