Closed gabrielaRazo closed 7 months ago
@gabrielaRazo In the project where this is happening, ensure react is installed as a dependency
have the same issue, was on nextjs 14
@jordant97 Would you create a sample-repo?
My bad, got it working following #125
@jordant97 Great to hear, then I close this again
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.
I'm using react v18.2.0 and next v14.1.0
@robyn3choi Can you make a test repo where this happen?
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.
@robyn3choi Try to upgrade to npm i react-reader@2.0.9
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"
}
}
},
Thanks, it's working for me now!
Great!
I noticed that the new version (2.0.4) had an error on the node-modules. It is a simple export error that I solved on local but when I try to upload my app the same error is shown on the pipeline. It is possible to solve that error without having to install the 1.2.2 version?