react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

Open luokelong opened this issue 4 months ago • 7 comments

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

"@react-pdf/renderer": "^4.0.0", "next": "14.2.13",

"use client";

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

const Pdf = () => {
  return (
    <PDFViewer width="100%" height="100%">
      <Document>
        <Page size="A4">
          <View>
            <Text>Hello World!</Text>
          </View>
        </Page>
      </Document>
    </PDFViewer>
  );
};

export default Pdf;

luokelong avatar Sep 29 '24 11:09 luokelong