NextJS Partytown CORS errors

Hello,

I tried to setup Partytown on a BuilderIO-NextJS project. It was a partial success up to the point that I am facing CORS errors coming from the library. I tried several approaches and followed the documentation guide of installation and setup of Partytown but no success so far with the CORS issues. Can you please assist with this.

My setup is as follows:
Installed the packages and added the scripts in package.json to relocate the partytown resources to the public folder:


image

enabled the experimental nexrScriptWorkers in the next.config file:

invoked the Partytown component and added the gtm script with type text/partytown in the app.tsx file with some console.logs to try the proxying mechanism but is seems like it does not work for some reason (the logs are not present in the console yet the requests from partytown to external resources are made):

Another approach which was taken was to initialize and setup partytown in the document.tsx file using this approach:

Again unfortunately there was no success in battling these CORS errors:



Hi Mariya,

To reach out to the Partytown and Qwik open source project teams , please head over to our Discord and join the discussion there. For the best results, I would recommend you make a copy of your implementation of Partytown and place it in a Stackblitz project for review, then share it with the #general-partytown channel.

You are also welcome to reach out for Partytown help by creating a discussion topic or Issue in the Github repo: