Skip to content

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

Closed
@Brandon-Perry

Description

@Brandon-Perry

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

Possible Solution

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    v7Issues related to Pixi React v7

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions