Home
Support Forums

After removing snippet injection (e.g Google Analytics) from netlify and moved it instead in codes, after doing deployment, an error occured upon accessing the app

Netlify Site Names:

  1. https://staging--adu-check-nextjs.netlify.app/
  2. https://adu-check-nextjs.netlify.app/

Domain: https://aducheck.com

Issue:
Upon learning that snippet injection is not working on SSR, we tried to moved/load the snippet injection (Google Analytics, Userway, Cookie and Facebook Pixel) into the source code. Upon testing these changes using netlify dev, it works and behaves properly. Even when running our local copy to using netlify CLI, it works smoothly.

Upon deploying the said code changes to staging, we see that the deployment went fine.

However, when checking the application: we are now seeing this:

Even in preview we are seeing this. Please note that at this time, the snippet injections are removed.

We tried to revert back our previous build from github, since the application using CI/CD but still we are seeing the same error. Even trying to rebuild clear cache and redeploy is resulting from the same error.

Could you please kindly check on this and let us know your feedback.

Additional info: The application is build on NextJS and as well, we are using ESLint as node_bundler.

Thank you.

Kind Regards,
Mer

Since you mention SSR, I’m presuming that the page (https://619655b9e6e1e837377f20f8--adu-check-nextjs.netlify.app), isn’t being built static as part of the build process, but rather “on demand” via a function.

If that’s the case then the success of your build processes is largely irrelevant, since the build can be successful and deploy, but the function encounter a runtime error, which since this is a node.js related error and returns a 502 response code, is what this appears to be.

I can’t tell you for certain what is wrong, as I’m just a community member and have no visibility on the project, but you might want to check the logic that’s responsible for the SSR.