This is really helpful! I've been learning web dev for a while, and I'm currently building my first ever project using astro and svelte. It's been really hard to find astro tutorials, and you give me just what I need!
Hello from Argentina. I need your help to solve my problem, please. Your tutorial was really helpful, but when the code went into production, I had a problem with 'CORS'. Do you know how to fix that? Thank you!
To make this work, I also had to configure astro.config.mjs wtih: ``` import { defineConfig } from "astro/config"; import partytown from "@astrojs/partytown"; export default defineConfig({ integrations: [ partytown({ // Adds dataLayer.push as a forwarding-event. config: { forward: ["dataLayer.push"], }, }), ], }); ```
Yeah it wasnt working for me either. But I found another blog post about this that led me to this code. This is a pretty big issue. This comment should be pinned or something.
From the docs """ Partytown is a lazy-loaded library to help relocate resource intensive scripts into a web worker, and off of the main thread. If you’re using third-party scripts for things like analytics or ads, Partytown is a great way to make sure that they don’t slow down your site. """