widgetti / widgetti/ipyreact

Cannot read properties of null (reading 'useReducer')

Open
#58 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
134
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Hi all,

Thanks for your open libraries, loving working with Solara so far!

I just discovered ipyreact also and I'm trying to see how easy it is for using react libraries with.

Currently trying to demo the react-pdf library and have overcome earlier errors but I'm now getting "Cannot read properties of null (reading 'useReducer')"

My code is the following:

import ipyreact

ipyreact.Widget(
    _esm="""
    import { Document, Page, pdfjs } from "https://esm.sh/react-pdf";
    import * as React from "react";


    pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`;

    export default function MyApp() {

      return (
        <div>
          <Document file="https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf" >
          </Document>
        </div>
      );
    };
    """
)

Hoping you might be able to advise.

Thanks a lot

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

Start by reproducing the embedded _esm example with react-pdf in ipyreact and inspect the reported useReducer error. Compare the Document and Page imports with a minimal React component to isolate the failing integration. Done means identifying a supported configuration or documenting the incompatibility and required project change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.