-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[experimental] nextScriptWorkers doesn't work with GTM #36123
Comments
So I'm having the same issue. I can't 100% say that my issue is caused for the same reason, but I'm also trying to load GTM in the same way as the above. To add some extra information though, I see this console error:
This is after I had the following in my
Just incase this helps, here's the Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000
Binaries:
Node: 16.14.2
npm: 8.5.0
Yarn: 1.22.18
pnpm: N/A
Relevant packages:
next: 12.1.5
react: 18.0.0
react-dom: 18.0.0
warn - Latest canary version not detected, detected: "12.1.5", newest: "12.1.6-canary.2".
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue |
Thanks for flagging this issue folks. Unfortunately the In the meantime, you could store and access the GTM script from a static file in <Script
strategy="worker"
src="/scripts/gtm.js" // script stored in public/scripts/gtm.js
/> |
I'll be closing this issue in place of #36318, but please feel free to ask any more questions here if you have any 🙏 |
@housseindjirdeh I updated my Nextjs to 1.12.6 and tried using worker strategy but I'm facing an issue, I'm using Partytown but Partyproxy is making a lot of requests on each page I visit. I'm using Next so I don't have any configs for PartyTown, I just put my script's strategy as a worker |
@RigottiG Do you have a reproduction that shows this many requests happening in the worker? I can help you investigate why that's happening and figure out if we should file an issue on the Partytown repo :) |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Chrome 100.0.4896.75
How are you deploying your application? (if relevant)
next dev
Describe the Bug
I'm trying to use worker strategy to load third party scripts, but it doesn't work properly. I follow the docs and set
nextScriptWorkers: true
flag innext.config.js
, install partytown when requested, and set by third-party script strategy toworker
, but it seems doesn't work.Expected Behavior
Load third party scripts
To Reproduce
nextScriptWorkers: true
flagworker
The text was updated successfully, but these errors were encountered: