-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Uncaught Error: Script error for: trackingCode error on every frontend page #12828
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
Comments
@poojawebkul , thank you for your report. |
@magento-engcom-team issue is updated please check. |
uBlock Origin extension is the source of the issue. It blocks the trackingCode.js file before it has the time to track you down. And that seems to be justified. Here is the content of
And where does that lead to ? ==> A tracking script.. http://t.trackedlink.net/_dmpt.js I cannot judge Magento team for recently integrating several external services into the Magento core (thinking of Shopial_Facebook & Dotdigitalgroup_Email). They may have some well justified commercial reasons. But at least, it shouldn't break other functionalities if we're trying to protect our own privacy. For instance:
The solution may be here: https://stackoverflow.com/a/27626398/2110948 |
This file isn't minified during |
We had the same problem also with uBlock. After deactivating dotmailer extension checkout works again. |
@poojawebkul , thanks for your update. |
Please read the replies @magento-engcom-team The issue is with uBlock, and may [will certainly] happen when real life customers will visit our Magento site with uBlock activated. When uBlock forbids You shall fix this issue by catching the RequireJS exception when Doing this, the JS execution flow would not be broken whenever a customer uses uBlock. Some example of such a catch block can be found here |
@magento-engcom-team Actually issue is only coming when uBlock is activated (as shown in the screenshot), otherwise, no error is coming. |
@poojawebkul, thank you for your report. |
@magento-engcom-team it seems to me that magento's checkout shouldn't fail because non essential js won't load. That's a simply horrible thing to describe as "correct Magento behavior". The checkout in particular should be made as resilient as possible. @Yonn-Trimoreau gives a solution, perhaps you should consider implementing it for all non essential core js instead of shrugging it off. Responses like this really make me fear for the direction of this project. |
Hello Team, Having same issue with one more error. [2017-12-27 12:13:20] main.CRITICAL: Unable to resolve the source file for 'frontend/Vishal/base/en_US/trackingCode.js' [] [] Please let us know what is the solution? |
Hello, I upgraded with composer , With no errors i hope to find a solution |
Hi, |
Running into the same issue over here after upgrading to version 2.2.2. Disabling uBlock Origin fixes the problem, yet that's not the correct solution. @magento-engcom-team: if a user chooses to install an ad/tracking blocker in his/her browser to avoid being tracked by a million different services and wants to make a website load faster because of not loading in megabytes of unnecessary javascript code, then the website should keep working properly. A website shouldn't stop working just because a user chooses to block certain non-essential scripts which tracks his/her behaviour. In this case, blocking Please remove the |
same issue with any ad blocker . it breaks the checkout process. I don't think any program should track user and store owners without their consent and their should be a way for this type of tracking to be turned off and it should be notified to store owners about them . i reinstalled 2.2.1 and i don't see this issue. |
Another solution is to just disable the Dotdigitalgroup_Email module. Its just cruft anyway. |
Disabling Dotdigitalgroup_Email isn't a solution where DotMailer integration is required. All tracking modules must fail gracefully and without further impact where end-users have implemented tools to block tracking. The secondary concern here is why is Magento core including 3rd party integrations that are installed enabled by default? It's fine to include these common integrations as standard, but they should be disabled until the site owner decides to use them. |
Still same issue and there is no solution. |
Here is a solution that works for all JS files required through In your theme, create the file: Copy & paste contents from: Add a third parameter to the require function call inside the
As an example, for Magento 2.2.2, you should replace this:
By this:
Remove the folder You should now see in your JS console that the error thrown by requireJS is replaced by a warning instead of a fatal error breaking the JS execution flow. Beware that it will catch all requireJS loading errors made through I would personally replace |
@Yonn-Trimoreau: sounds like a good solution. Any chance you could propose this in a Pull Request, I think the Magento devs will be able to give you faster feedback when creating a PR then they will in this issue, since they don't seem to think this is a real issue :p |
Yes, I could. But what's bothering me is that I found a solution only for scripts initiated using I'm still looking for enhancements, maybe here... It would be very interesting if a Magento core developer could come by this topic and give his opinion. I'm still investigating and I will link my PR to this topic if I do so. |
PR done. I was thinking of a better solution but I don't have enough time to do it: http://mydons.com/error-handler-with-requirejs/ |
Removing label for re-evaluation, for me personally this issue looks definitely as must-be-fixed. |
Can you also remove the non-issue label on the PR please? |
Hi @poojawebkul. Thank you for your report. The fix will be available with the upcoming patch release. |
Hello @magento-team, thanks for the notification. |
I've implemented @Yonn-Trimoreau's fix. I'm still investigating, but my checkout breaks (checkout-loader is never hidden) when the google analytics script (from Magento_GoogleAnalytics) is blocked. I need to check with luma but on my theme disabling Magento_GoogleAnalytics or ublockorigin fixes the issue. I've tried editing Magento_GoogleAnalytic\view\frontend\templates\ga.phtml to use "require(" directly instead of "x-magento-init" and it shows the same behaviour, even with the require error caught (the blocked GET error still seems to escape...) Edit: ah just found #12428 describing the issue. #13061 does not fix this. |
Have you remove the file If it still does not work and you want to try using
I have not tried my fix against Google Analytics script loading error. |
@Yonn-Trimoreau you've probably seen in the other issue but it's definitely loading the new js. I also tried require directly, bizarrely that doesn't work either. I'm just going to block the script on the effected pages of the checkout (maybe them all!) |
Not to derail this too much, but I don't think dotmailer has any business being included by default.
I am judging them for force-adding a third party service that they are almost certainly getting payment for, only for it to break core functionality for a large subset of users. If they insist on including dotmailer, it should have been disabled by default. That it broke core functionality when using tracker blockers elevates this issue from nuisance to a serious lapse in judgement. Isn't that the purpose of Magento's extensibility, so site owners can pick and choose what external fee-based services they'd like to utilize? |
Hi @poojawebkul. Thank you for your report.
The fix will be available with the upcoming 2.3.0 release. |
This needs backporting to 2.2.x. Along with all the fixes for similar issues.
|
@lingwooc Welcome to Magento 2 World, a world that maintains 3 branches, 2.0, 2.1 and 2.2, and you dont't know why when you understand how many bugs are corrected in 2.2, and not in 2.1, in 2.1 and not in 2.0. And when they close tickets saying "solved in 2.3". And you just want to slap everyone. |
Hopefully you can backport this yourself by making your own module (this fix is not too hard.. and I explained how to do it in your own module before).. Or you could update to latest version.. Still, maintaining 3 branches at a time seems like a whole lot of mess.. |
It is at least tagged as being fixed in 2.2.x now. I do wonder how many sites can't/couldnt sell to people with and blockers and they don't even know! Sadly having three branches isn't the worst of the mess :( and this is just the result of disgracefully crap testing |
@lingwooc The big problem is that it seems some tickets are noted "Fixed in 2.2.x", and when you check merges, it is not true... I don't know for this particular bug, but i saw many threads where people are asking question such as "I can't find it in 2.2.x, am i wrong ? " with no further response... |
@pravalitera oh...well...what can you say? At least we aren't paying them for it. |
Have an M2.2 installation and problem exists if using ad/tracking blocker on Safari. |
I have this issue with Magento 2.2.3. It's great that is appears resolved in the 2.3 branch, but it is now more than 2 months since that post and 2.3 isn't released. |
This fix does not work; manually applied it to 2.2.3, Safari 11.1, Mac High Sierra Enabling JS Bundling solved the problem for me. |
This pull request solves the root cause of the issue: #14874 History states it was fixed in 2.2.5, but I only see the changes in 2.2.6+. |
This is the actual solution and it works for me. Please check this link #13346 (comment) Thanks |
Preconditions
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: