pixi-react icon indicating copy to clipboard operation
pixi-react copied to clipboard

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

Open Brandon-Perry opened this issue 1 year ago • 1 comments

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:

  • Run npx create-next-app@latest in dir
  • Select default options
  • Install latest versions of Pixi and React Pixi
  • Create any Pixi component and place it in app/page.tsx. Make sure it's a client component (add 'use client' to top of page)
  • Run npm run dev
  • Failure?

Environment

  • @pixi/react version: 7.1.1
  • pixi.js version: 7.3.3
  • React version: 18.0.0
  • ReactDOM version: 18.0.0
  • Browser & Version: Chrome Version 120.0.6099.234 (Official Build) (arm64)
  • OS & Version: Mac Ventura 13.2.1
  • Running Example: https://pixiplayground.com/](https://codesandbox.io/p/devbox/pixinext-issue-spxnsl

Possible Solution

No response

Additional Information

No response

Brandon-Perry avatar Jan 24 '24 03:01 Brandon-Perry

same problem here

braveltd avatar Sep 19 '24 01:09 braveltd

Closing since v7 is no longer the latest version and will only receive security updates moving forward.

trezy avatar Mar 01 '25 23:03 trezy