Skip to content
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

Loading chunk 692 failed on Firefox 109.0 and Safari 16.2 #392

Closed
ilario-pierbattista opened this issue Feb 2, 2023 · 9 comments
Closed
Labels
bug Something isn't working customer Input

Comments

@ilario-pierbattista
Copy link

ilario-pierbattista commented Feb 2, 2023

Description

Starting from 2023-01-30 we started to get the following load error from users with Firefox 109.0 and Safari 16.2 browsers (both desktop and mobile versions).

Loading chunk 692 failed. (error: https://js-agent.newrelic.com/692.215647de-1223.js)

Steps to Reproduce

I didn't manage to reproduce the error. I've tried to use Firefox 109 (on Ubuntu), but it seems to work.
On the other hand, I see a lot of incoming traffic from Firefox 109 browsers that doesn't report a load failure.
It seems to fail randomically.

Expected Behavior

The script load should never fail.

Relevant Logs / Console output

Loading chunk 692 failed.
(error: https://js-agent.newrelic.com/692.215647de-1223.js)

Your Environment

  • php NR agent version: 10.5.0.317
  • the agent is configured to auto inject the js script
@ilario-pierbattista ilario-pierbattista added bug Something isn't working needs triage labels Feb 2, 2023
@workato-integration
Copy link

@patrickhousley
Copy link
Contributor

Morning @ilario-pierbattista and thanks for reporting this issue. With version 1220, the browser agent began using lazy chunked loading making the initial code that has to be injected into the HTML smaller. We have noticed that certain browsers with more restrictive privacy settings like Firefox with Strict privacy control enabled, DuckDuckGo browser, and ad blockers will block the agent from loading the additional JS resources it needs at runtime. This results in the error you are describing.

We are planning to make that message in the browser console more user friendly. We are also looking for feedback on other options for addressing this concern. Please feel free to share your opinions and feedback, we take all feedback very seriously and ensure it feeds into product development at New Relic.

@ilario-pierbattista
Copy link
Author

Hello @patrickhousley, thank you for your reply.
I confirm that configuring Firefox in strict privacy mode made me reproduce the load error.

Maybe the lazy chunked loading could be disabled by configuring the agent?

@patrickhousley
Copy link
Contributor

Thanks for the feedback @ilario-pierbattista , that is one of the options we are considering. Below is the size difference in the code that must be injected into the HTML.

With Code Splitting

File Size File Name
53K nr-loader-full-1223.min.js
32K nr-loader-rum-1223.min.js
59K nr-loader-spa-1223.min.js

Without Code Splitting

File Size File Name
104K nr-loader-full-1223.min.js
85K nr-loader-rum-1223.min.js
110K nr-loader-spa-1223.min.js

@bartosz-zolynski
Copy link

Confirmed for the browser versions mentioned. Also seen on Safari 16.0. As a "bonus", all e2e tests written in Cypress also started to fail across all the different sub-projects. Interestingly enough, we had *.newrelic.com included on the blockHosts list in Cypress config but it didn't prevent tests to fail. Only after removing this domain from blockHosts made tests working again. Not sure what could be the cause of it?

@patrickhousley
Copy link
Contributor

patrickhousley commented Feb 8, 2023

How are you injecting the agent? The agent is usually contained in the HTML file as an inline script. It will then lazy load chunks from our CDN https://js-agent.newrelic.com/. With that blockHosts in place, the agent will not load and will console.error an error like the one in the original post.

With 1223, we resolved an issue where some sites were redefining the global self variable that was breaking the webpack lazy loader. However, we have also noticed that the chunks can be blocked due to browser privacy settings and/or ad blockers. Privacy settings and ad blockers could also block the network requests the agent makes to send the collected data to New Relic.

Please keep in mind that, if the agent lazy chunks are currently being blocked by privacy settings and/or ad blockers, changing to a single agent file (removing the use of lazy loading) could still result in data not being captured due to those network requests being blocked as well.

As an interim solution, we are making a change in 1224 (eta tbd) to capture the chunk load errors and provide a better message to the console. For the long term, we are actively exploring options with regards to the above mentioned privacy settings and ad blocker issue.

@cwli24
Copy link
Contributor

cwli24 commented Feb 9, 2023

We found where we had internal uncaught Promises that was causing this problem; culprit was introduced in v1223 restructuring. Thank you for the report!

Edit: To be clear, we're just working to silence this error as there's nothing we can practically do at this time to prevent content blockers from nullifying the agent.

@workato-integration
Copy link

Work has been completed on this issue.

@smokinjoe
Copy link

https://issues.newrelic.com/browse/NEWRELIC-6637

Your cert has expired - I'm trying to determine if this issue is similar to one I'm experiencing when trying to integrate 1.257.0 into my react app but chrome refuses to let me view the page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer Input
Projects
None yet
Development

No branches or pull requests

5 participants