jnsmalm / pixi3d

The 3D renderer for PixiJS. Seamless integration with 2D applications.
https://pixi3d.org
MIT License
763 stars 44 forks source link

Error: Extension class must have an extension object #160

Closed Horsetoast closed 1 year ago

Horsetoast commented 1 year ago

Hi! I was trying to use pixi3d in React but can't even get a basic setup working. The error comes from https://pixijs.download/dev/docs/packages_extensions_src_index.ts.html line 79. I'm not sure if this is pixi.js or pixi3d issue, but I could run pixi.js code just fine.

https://codesandbox.io/s/staging-leaf-6sho2x?file=/src/_app.js

Horsetoast commented 1 year ago

Hmm, it seems to work with pixi.js@6.X but not with version 7

jnsmalm commented 1 year ago

Hi!

When using PixiJS v.7+ you need to import from "pixi3d/pixi7" instead of "pixi3d", like this:

import { Mesh3D } from "pixi3d/pixi7";

Horsetoast commented 1 year ago

Thanks for the quick reply! When I tried that, it made me install @pixi/assets@^7.1.2. I did that, now I'm seeing a different bunch of errors. I haven't tinkered with it much, I'll try again when I get home. image

And by the way, great library! I got a chance to play with it using v6. Must have been a lot of work.

jnsmalm commented 1 year ago

That's weird because I didn't change anything else than the import statement in your code and it worked.