pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.24k stars 172 forks source link

Bug: TypeError: Cannot read properties of null (reading 'stage') #472

Open Brandon-Perry opened 5 months ago

Brandon-Perry commented 5 months ago

Current Behavior

If I make a Pixi component and use it in my NextJS app, it causes this error to appear: Unhandled Runtime Error TypeError: Cannot read properties of null (reading 'stage')

This will happen even if Stage is the only Pixie React component.

I've made sure that it as a client component and I've also tried using dynamic imports. Neither worked.

I tried reproducing it in a code sandbox, but there it actually worked! It's the exact same code, so I don't know what the issue is.

Expected Behavior

It not to immediately crash

Steps to Reproduce

https://codesandbox.io/p/devbox/pixinext-issue-spxnsl Note that this works

Steps for my local version that didn't work:

Environment

Possible Solution

No response

Additional Information

No response