Giter Site home page Giter Site logo

Comments (12)

gerhardsletten avatar gerhardsletten commented on June 18, 2024

@gabrielaRazo In the project where this is happening, ensure react is installed as a dependency

from react-reader.

jordant97 avatar jordant97 commented on June 18, 2024

have the same issue, was on nextjs 14

from react-reader.

gerhardsletten avatar gerhardsletten commented on June 18, 2024

@jordant97 Would you create a sample-repo?

from react-reader.

jordant97 avatar jordant97 commented on June 18, 2024

My bad, got it working following #125

from react-reader.

gerhardsletten avatar gerhardsletten commented on June 18, 2024

@jordant97 Great to hear, then I close this again

from react-reader.

robyn3choi avatar robyn3choi commented on June 18, 2024

I'm getting this error after upgrading to 2.0.4. I'm not sure how jordant97 used #125 to solve it. Adding a height and width to the component's parent element didn't help.

from react-reader.

robyn3choi avatar robyn3choi commented on June 18, 2024

I'm using react v18.2.0 and next v14.1.0

from react-reader.

gerhardsletten avatar gerhardsletten commented on June 18, 2024

@robyn3choi Can you make a test repo where this happen?

from react-reader.

robyn3choi avatar robyn3choi commented on June 18, 2024

Sure, here's a test repo - https://github.com/robyn3choi/react-reader-bug. Running yarn dev and going to localhost:3000 will result in that error.

from react-reader.

gerhardsletten avatar gerhardsletten commented on June 18, 2024

@robyn3choi Try to upgrade to npm i [email protected] and change your code to: (you need a height/width for parent element)

<main className="h-screen w-screen">
  <ReactReader
    url="https://react-reader.metabits.no/files/alice.epub"
    location={location}
    locationChanged={setLocation}
  />
</main>

The problem was that react-reader's package also need to have and exports field and NextJS was not able to load the es-module with the module field

"exports": {
  ".": {
    "import": {
      "types": "./dist/index.d.ts",
      "default": "./dist/react-reader.es.js"
    },
    "require": {
      "types": "./dist/index.d.ts",
      "default": "./dist/react-reader.umd.js"
    }
  }
},

from react-reader.

robyn3choi avatar robyn3choi commented on June 18, 2024

Thanks, it's working for me now!

from react-reader.

gerhardsletten avatar gerhardsletten commented on June 18, 2024

Great!

from react-reader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.