diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
14.9k stars 1.18k forks source link

When I try to run my code It shown an error in yoga-layout and "@react-pdf/renderer" #2684

Closed vel-kathir closed 1 month ago

vel-kathir commented 7 months ago

Package.json { "name": "adminportal", "version": "1.4.2", "private": true, "dependencies": { "@ckeditor/ckeditor5-react": "^3.0.2", "@date-io/date-fns": "^1.1.0", "@date-io/moment": "^1.3.13", "@emotion/styled": "^11.9.3", "@material-ui/core": "^4.12.3", "@material-ui/data-grid": "^4.0.0-alpha.23", "@material-ui/icons": "4.11.2", "@material-ui/lab": "^4.0.0-alpha.58", "@material-ui/pickers": "^3.3.10", "@mui/icons-material": "^5.0.0", "@mui/material": "^5.10.4", "@mui/styles": "^5.9.2", "@react-pdf-viewer/core": "^2.9.1", "@react-pdf-viewer/selection-mode": "^2.9.1", "@react-pdf-viewer/zoom": "^2.9.1", "@react-pdf/renderer": "^2.0.21", "@tinymce/tinymce-react": "^3.13.0", "apexcharts": "^3.35.5", "axios": "^0.21.1", "bootstrap": "4.4.1", "chart.js": "^3.5.1", "ckeditor5-custom-build": "file:ckeditor5", "clevertap-web-sdk": "^1.1.1", "date-fns": "^2.29.3", "draft-js": "^0.11.7", "env-cmd": "^10.1.0", "express": "^4.17.1", "file-saver": "^2.0.5", "formik": "^2.2.6", "fs": "0.0.1-security", "history": "4.10.1", "html-react-parser": "^1.4.0", "jquery": "^3.5.1", "jspdf-autotable": "^3.5.25", "material-table": "^1.57.2", "mime": "^2.5.2", "moment": "^2.29.1", "papaparse": "^5.3.0", "pdfjs-dist": "^2.6.347", "react": "^16.13.1", "react-apexcharts": "^1.4.0", "react-audio-player": "^0.17.0", "react-beforeunload": "^2.2.4", "react-chartjs-2": "^3.0.5", "react-date-range": "^1.4.0", "react-dom": "^16.13.1", "react-draft-wysiwyg": "^1.14.7", "react-draggable": "^4.4.4", "react-dropzone": "^11.3.4", "react-export-excel": "^0.5.3", "react-file-viewer": "^1.2.1", "react-filter-search": "^1.0.11", "react-google-login": "^5.1.21", "react-icons": "^3.11.0", "react-magic-slider-dots": "^1.2.2", "react-multilevel-dropdown": "^2.0.0", "react-paginate": "^6.3.2", "react-player": "^2.9.0", "react-redux": "7.1.3", "react-responsive-carousel": "^3.2.18", "react-router-dom": "5.1.2", "react-scripts": "3.4.1", "react-select": "^4.3.1", "react-slick": "^0.27.10", "react-spinners": "^0.11.0", "react-tinymce": "^0.7.0", "reactstrap": "8.4.1", "redux": "4.0.5", "redux-devtools-extension": "^2.13.9", "redux-logger": "3.0.6", "redux-thunk": "2.3.0", "serve": "^11.3.2", "slick-carousel": "^1.8.1", "sonarqube-scanner": "^2.8.0", "store": "2.0.12", "styled-components": "^5.3.0", "xlsx": "^0.17.3", "yoga-layout": "^3.0.2", "yup": "^0.32.9" }, "devDependencies": { "@babel/eslint-parser": "^7.15.4", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-transform-runtime": "^7.24.3", "babel-eslint": "10.1.0", "dotenv": "^8.2.0", "eslint": "6.8.0", "eslint-plugin-react": "7.18.3", "prettier": "1.19.1" }, "scripts": { "setup": "npm i --legacy-peer-deps", "start": " env-cmd -f .env react-scripts start ", "build": "env-cmd -f .env.production react-scripts --max_old_space_size=4096 build", "build:development": "env-cmd -f .env.development react-scripts --max_old_space_size=4096 --openssl-legacy-provider build", "build:lms": "env-cmd -f .env.lms react-scripts --max_old_space_size=4096 build", "build:staging": "env-cmd -f .env.staging react-scripts --max_old_space_size=4096 build", "build:qa": "env-cmd -f .env.qa react-scripts --openssl-legacy-provider build", "build:production": "PORT=8000 env-cmd -f .env.production react-scripts build", "build:new": "env-cmd -f .env.new react-scripts --max_old_space_size=4096 build", "start:dev": "env-cmd -f .env.development react-scripts start", "start:stage": " env-cmd -f .env.staging react-scripts start", "start:qa": " env-cmd -f .env.qa react-scripts start", "start:prod": "PORT=8000 env-cmd -f .env.production react-scripts start", "qa": "env-cmd -f .env.qa react-scripts start", "lms": "env-cmd -f .env.lms react-scripts start", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", "lint": "eslint src//.js src//.jsx", "prettier": "prettier \"src/*/.{js,jsx}\"", "prettier:check": "yarn prettier --check", "prettier:fix": "yarn prettier --write" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

./node_modules/yoga-layout/src/index.js 13:26 Module parse failed: Cannot use keyword 'await' outside an async function (13:26) File was processed with these loaders:

jeemok commented 3 months ago

anyone found a solution to this?

diegomura commented 1 month ago

You had "yoga-layout": "^3.0.2" installed for some reason. We aren't shipping this until next version of react-pdf. It should no longer be a problem there