I need to use pixi legacy to support when WebGL is disabled.
So I try to use pixi.js-legacy, but it does not work with Rollup.
It occur like under error with this line.
Uncaught TypeError: Cannot define property CanvasPrepare, object is not extensible
I think it is occurred by this reason.
Is there another way to use pixi legacy?
pixi.js version: _5.1.2_Yes, you can, its supposed to work.
If you or someone else finds whats wrong with it. Maybe its something about default exports? we just refactored it in dev branch.
If the Object.assign is the issue, there are definitely other ways that we can handle that. It would be helpful if @egaoneko you could create a simple repo that reproduce this? That would be very helpful.
@ivanpopelyshev
I'll try with dev branch.
@bigtimebuddy
I made a simple repo for test.
https://github.com/egaoneko/pixi-test
And this is a test page.
https://blog.smilecat.dev/pixi-test/examples/base/index.html
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I need to fix this. Bumping.
This is super annoying. Did anyone found a solution for this ?
I also would love to have a solution on this.
with import "pixi.js-legacy" Object.assign is the issue in the legacy build Error: Cannot add property CanvasPrepare, object is not extensible
with import "pixi.js" and "pixi-projection" (or any other method trying to manipulate PIXI) Error: Cannot add property ..., object is not extensible
...just annoying
Demo (legacy)
If someone wants to take a shot at this, basically we need to remove Object.assign from prepare and extract namespaces in the legacy bundle. Simplest option is we could remove the namespaces all together (for both bundles), add classes at the root and add deprecations. It鈥檚 kinda silly to have these namespaces since I鈥檓 sure the class names are unique and add unnecessary level of complexity. The downside is it makes the docs a little more organized, but not by much.
I added a PR to resolve this
Most helpful comment
If the
Object.assignis the issue, there are definitely other ways that we can handle that. It would be helpful if @egaoneko you could create a simple repo that reproduce this? That would be very helpful.