imagekit-developer / imagekit-developer/imagekit-video-player

`IKVideoPlayer` crashes with `TypeError: Cannot read properties of null (reading 'BigPlayButton')`

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Description

IKVideoPlayer crashes during Video.js initialization with the following runtime error, even in a minimal setup without Next.js or React Server Components:

Runtime TypeError: Cannot read properties of null (reading 'BigPlayButton')

The error occurs even when the player is not rendered (i.e. conditionally hidden via state), suggesting it is triggered by module-level side effects in the bundled Video.js code.

Stack trace

TypeError: Cannot read properties of null (reading 'BigPlayButton')
at i.getChild (node_modules/@imagekit/video-player/dist/react/index.mjs:36:53142)
at X4 (node_modules/@imagekit/video-player/dist/react/index.mjs:238:2457)
at (node_modules/@imagekit/video-player/dist/react/index.mjs:238:5252)

Reproduction

Reproduced on CodeSandbox in a minimal setup (no Next.js, no "use client", plain React).
https://codesandbox.io/p/sandbox/82s6st
Steps:

  1. Install @imagekit/video-player
  2. Import IKVideoPlayer from @imagekit/video-player/react
  3. Render it in a standard React component
  4. The crash occurs at runtime
Expected behavior

IKVideoPlayer should initialize without errors.

Environment
  • @imagekit/video-player: 1.0.0-beta.5
  • React: 19.2.4
Additional context
  • The error is a Video.js internal issue — getChild('BigPlayButton') returns null because the control bar / child components aren't ready when accessed.
  • The dist/react/index.mjs bundle contains the entire Video.js library and appears to run initialization code that accesses DOM elements before they are available.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash using the linked CodeSandbox with a minimal React component, then inspect the initialization path in dist/react/index.mjs around the Video.js getChild('BigPlayButton') call. Trace when the control bar and child components become available; done means importing and initializing IKVideoPlayer without the null-property TypeError, even when the player is conditionally hidden.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.