Relative Content

Tag Archive for node.jscorsxmlhttprequestbackendpuppeteer

Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Help me

this is my first post on Stack Overflow. I’ve recently been working on an online invoice generator using the MERN Stack with TypeScript. I have included an option to generate a PDF using the Puppeteer library when a button is clicked. This feature works fine on my local device. I have deployed the backend of this project on Render and the frontend on Vercel. However, when I click on the button to generate the PDF on the deployed page, the following error appears:
‘Access to XMLHttpRequest at ‘https://invoice-generator-1-yyv7.onrender.com/api/v1/generate-pdf’ from origin ‘https://invoice-ninja-aryan.vercel.app’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.’