Search code examples
reactjsreact-pdfreact-pdf-viewer

I am trying to integrate @react-pdf/renderer in my proyect and I get this error: "Uncaught TypeError: module.runSetters is not a function"


When I try to integrate @react-pdf/renderer into my project, it gives me the next error "Uncaught TypeError: module.runSetters is not a function"

Error:

Uncaught TypeError: module.runSetters is not a function

My code:

import React from "react";
import {
  Page,
  Text,
  View,
  Document,
} from "@react-pdf/renderer";


const Index = () => {
  
  return (
    <div>
      <Document>
        <Page >
          <View >
            <Text >Nombre 1</Text>
            <Text>Nombre 2</Text>
            <Text>Nombre 3</Text>
          </View>
        </Page>
      </Document>
</div>
)
}
export default Index;

Solution

  • Updating the npm package @react-pdf/renderer to version 2.1.2 and above seems to cause a Meteor-only bug that I'm having a hard time understanding. The error seems to come from this file node_modules/normalize-svg-path/index.mjs, but the runSetters function is nowhere to be found.