Describe the bug
I'm using partytown version ^0.10.2 in my Gatsy project to load GTM and Netlify to host the repo. Everything works fine in preview deployments but as soon as I make it live, partytown call in the network tab throws 404.
Screenshot from live site

Screenshot from deployment preview

I'm loading all the lib files in gatsby-node.js as suggested in https://partytown.builder.io/gatsby
I tried using both onPreBuild and onPreBootstrap but the output is the same. I tried it twice on the production site and reverted it.
Here is the code from my project
gatsby-node.js
exports.onPreBuild = async () => {
await copyLibFiles(path.join(__dirname, 'static', '~partytown'));
};
gatsby-ssr.js (inside onRenderBody)
setHeadComponents([
<Partytown key="partytown" forward={['dataLayer.push', 'gtag']} />,
<script key="google-analytics" type="text/partytown" src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GOOGLE_TAGMANAGER_ID}`} />,
<script
key="google-analytics-config"
type="text/partytown"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `window.dataLayer = window.dataLayer || [];
window.gtag = function gtag(){ window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.GOOGLE_TAGMANAGER_ID}', { send_page_view: false })`
}}
/>
]);
package.json (inside dependencies)
"@builder.io/partytown": "^0.10.2",
Am I missing something here?
Reproduction
Steps to reproduce
- Add partytown to Gatsby as shown above
- Load GTM inside partytown
- Deploy in Netlify, test the deployment preview (partytown should load normally)
- Publish the deployment to live site (partytown should throw 404)
Browser Info
Chromium
Additional Information
No response
Describe the bug
I'm using partytown version
^0.10.2in my Gatsy project to load GTM and Netlify to host the repo. Everything works fine in preview deployments but as soon as I make it live, partytown call in the network tab throws 404.Screenshot from live site

Screenshot from deployment preview

I'm loading all the lib files in
gatsby-node.jsas suggested in https://partytown.builder.io/gatsbyI tried using both
onPreBuildandonPreBootstrapbut the output is the same. I tried it twice on the production site and reverted it.Here is the code from my project
gatsby-node.js
gatsby-ssr.js (inside onRenderBody)
package.json (inside dependencies)
"@builder.io/partytown": "^0.10.2",Am I missing something here?
Reproduction
Steps to reproduce
Browser Info
Chromium
Additional Information
No response