<Script /> tag doesn't load on page change, only window reload #55506
Replies: 7 comments
-
this affects us on Next.Js 13, app router while trying to integrate reviews.io |
Beta Was this translation helpful? Give feedback.
-
i am stuck on this as well, next link and script tag not executing javascript until i do hard refresh |
Beta Was this translation helpful? Give feedback.
-
Having the same issue - we've decided to just use |
Beta Was this translation helpful? Give feedback.
-
facing same issue |
Beta Was this translation helpful? Give feedback.
-
Facing similar issue with nextjs 14.2.3 |
Beta Was this translation helpful? Give feedback.
-
Possible duplicate: #57023 |
Beta Was this translation helpful? Give feedback.
-
haha both my issues, not sure how I accidently asked twice, but this is still an annoying issue for me. The current workaround is just manually creating and appending scripts to the DOM, but why even have the Next.js
|
Beta Was this translation helpful? Give feedback.
-
Summary
Hi!
I initially thought my issue was related to this (#17919 (reply in thread)) (you can see me discussing my issue at the bottom lol) but realized this was asked for the lowercased, vanilla HTML
<script />
tag, not the Next.js, uppercased<Script />
component. My issue is exactly the same, but I will add some context on my issue. In the issue (#17919 (reply in thread)) I commented on, his script function seems to properly load my external script when theonLoad
function has some work to do within (using the dice.fm widget), but doesn't change the outcome of my script that just needs the script loaded, and no other functions loaded within (SweepWidget). I have poked around by switching thestrategy
prop value as well as usingonReady
instead ofonLoad
, but nothing seems to work. MydidFail
/failedLoad
check before loading the script doesnt ever seem to be hit either.Am I using this Script component wrong? Or is this a bug? Or is this an issue with the scripts from the 3rd parties? Any feedback helps! Thanks!
SweepWidget
DiceWidget with <Script/> tag usage
DiceWidget after issue ref <script /> update that works, but throws a
ReferenceError: document is not defined
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions