QwikDev / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.qwik.dev
MIT License
13.12k stars 438 forks source link

Partytown won't work with Angular Scully SSG (puppeteer) #390

Closed vptill closed 1 year ago

vptill commented 1 year ago

I have been trying to integrate Facebook Pixel with Partytown into my Angular 15 app, which uses @scullyio/scully SSG plugin with puppeteer to prerender the pages.

Partytown works perfectly in development mode and with ng build, however, the prerender process with scully gives an error, which is getting saved in the pre-rendered HTML as well, and it won't work in production mode possibly because of that.

I have tried to disable the pixel code during the prerender, but it did not work, and even if I remove the error from the rendered HTML, it will give the same error: Error: * not found.

My code after prerender:

`

`

Could someone give me guidance on what should I try next? I am out of options as of now. I had no issues integrating it with Nuxt prerender, only with Scully.

vptill commented 1 year ago

I could fix this issue with the help of this:

https://github.com/scullyio/scully/issues/1609#issuecomment-1236552498