I am using react-pdf and react-pdf/renderer in nextjs after creating the file and adding the code it works perfectly but when I make the production build it continues to make the build and never stops. here is the code
import React from 'react';
import { Page, Text, View, Document, StyleSheet } from '@react-pdf/renderer';
const PDFGenerator = () => {
    const styles = StyleSheet.create({
        page: {
            flexDirection: 'row',
            backgroundColor: '#E4E4E4'
        },
        section: {
            margin: 10,
            padding: 10,
            flexGrow: 1
        }
    });
    return (
        <Document>
            <Page size="A4" style={styles.page}>
                <View style={styles.section}>
                    <Text>Section #1</Text>
                </View>
                <View style={styles.section}>
                    <Text>Section #2</Text>
                </View>
            </Page>
        </Document>
        
      );
}
 
export default PDFGenerator;
and here I am using it
                 <PDFDownloadLink
                    document={<PDFGenerator/>}
                    fileName="recipe.pdf"
                    className="button-background w-full text-center text-color py-2 px-4 
                     rounded mt-10">
                    {({blob, url, loading, error}) => (loading
                        ? 'Loading document...'
                        : 'Download PDF')}
                </PDFDownloadLink>
 
     
     
    