react-pdf
react-pdf copied to clipboard
TypeError: module.runSetters is not a function
Describe the bug
It throws this error module.runSetters is not a function
when I use it on Meteor React JS
.
I also tried npm ci
, delete node module
then reinstall, and also on version 2.3.0, all throw the same error as well.
Code:
Similar questions found online: https://stackoverflow.com/questions/73636378/i-am-trying-to-integrate-react-pdf-renderer-in-my-proyect-and-i-get-this-error/73642851#73642851
To Reproduce
You can make use of react-pdf REPL to share the snippet
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. MacOS, Windows]
- Browser [e.g. chrome, safari]
- React-pdf version [e.g. v1.1.0]
Same problem
Here's a very simple reproduction of the error: https://github.com/Floriferous/react-pdf-meteor-error
Here's a very simple reproduction of the error: https://github.com/Floriferous/react-pdf-meteor-error
Thanks for this!!!!
It seems like version 2.1.2 created this bug, whereas on 2.1.1 everything works fine. v3 has the same issue.
I tried with React 17 and 18, but there's no difference.
Thanks! I am going to have a look for 2.1.1, if there are not many differences with 2.3, I could roll back to use that version for now.
This talk about Meteor's Reify operation (https://blog.meteor.com/reify-meteors-evolving-javascript-module-compiler-70425fa45d81). This seems to be a problem related to Reify. Since React-PDF is an NPM library could you try to recompile it with Meteor's compiling system and see if there is any change (https://guide.meteor.com/using-npm-packages.html#recompile). I am not sure what changed here between versions. Will try to understand this a bit deeper.
Could be related to adding this: 'rollup-plugin-polyfill-node'