I have a NextJS app that has a page which has a sub-component on it that utilizes the isPropagationStopped
method from jQuery from within my index.js.
index.js is loaded from an external source, however it is definitely allowed through CSP.
On every other page on my site that I load, I can see that jQuery is loaded correctly, however for this particular page, I occasionally get an error:-
Uncaught TypeError: l.isPropagationStopped is not a function
at ta (index.js:37:31808)
The error only occurs:-
- in Production on our Vercel app
- on a direct page load of the URL in the browser (not when navigating to it from a link).
We have attempted to load index.js using the afterInteractive
strategy, and also defer=false
, but neither have solved the problem.
And because I can’t replicate this on local (running the same npm commands) I’m not sure what else I can do.
Does anyone know why this is happening or have any suggestions on what else we can check?
Thanks