Open rouvenst opened 1 year ago
Same problem, it would be great to have this working somehow.
I adapted @rouvenst code for our Qwik project and ended up in same dead end. I even tried to serve cookiebot scripts locally, modified code to rewrite urls for iframe too. In the end, it isn't working and I'm not sure how to proceed.
If you need help with testing, let me now. As for trying to find problem in partytown, I'm unfortunatelly out of my depth there.
I belive even some half-hack way would be better before it is possible to fix this properly.
Describe the bug I want to integrate Cookiebot (from UserCentrics, https://www.cookiebot.com/de/) into my Nuxt-App and make use of partytown. Installation works flawlessly. The reverse proxy works as well (thumbs up to your documentation). Reverse Proxy is implemented with Cloudflare functions.
The script of Cookiebot is added to
nuxt.config.ts
, therefore added to the<head>
segment. With theresolveUrl
script configured innuxt.config.ts
, the script is retrieved. Inside the Cookiebot script are references to other sites and scripts (bc-v4.min.html
andcc.js
). As they get fetched, the code ofresolveUrl
is ignored and direct calls against the Cookiebot site happen (e.g.https://consentcdn.cookiebot.com/sdk/bc-v4.min.html
). This results in CORS errors making Cookiebot unusable.Could relate to #243
To Reproduce Steps to reproduce the behavior:
npm install
npx wrangler pages dev -- npm run dev
(maybe install wrangler beforehand, https://developers.cloudflare.com/pages/platform/functions/local-development/)Reproduction link https://github.com/rouvenst/nuxt-partytown-cookiebot
Expected behavior Subsequent http calls from within a script which is loaded partytown should use resolveUrl to make use of the reverse proxy.
Partytown version
0.7.6
+"@nuxtjs/partytown": "^1.3.0"
Screenshots