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

TypeError: Converting circular structure to JSON in Angluar apps in Preview Mode #487

Closed
Starker3 opened this issue May 23, 2022 · 15 comments · Fixed by #489
Closed

TypeError: Converting circular structure to JSON in Angluar apps in Preview Mode #487

Starker3 opened this issue May 23, 2022 · 15 comments · Fixed by #489

Comments

@Starker3
Copy link

Same type of issue as #185
However, this is happening on the most recent version of Matomo (4.10.0).
This issue seems to only be happening on sites that use Angular (PHP sites for example do not have the issue using the same container).

image

The user was able to reproduce the error by first clicking a button on their site and then clicking on the Event in the preview mode iFrame:
image

This results in a blank preview page and the above error in the console:
image

I've asked the user to confirm if the same was happening in 4.9 or if it only started after the update to 4.10.0
Will add a comment here if I get confirmation about that.

@Starker3
Copy link
Author

User downgraded to 4.9 and the same issue is still present.

@AltamashShaikh
Copy link
Contributor

@Starker3 I tried replicating the issue by creating a test HTML, but unable to reproduce it

<!DOCTYPE html>
<html lang="en-US">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>


<div ng-app="myApp" ng-controller="myCtrl">
    Name: <input ng-model="firstname">
    <h1>{{firstname}}</h1>
</div>

<script>
    var app = angular.module('myApp', []);
    app.controller('myCtrl', function($scope) {
        $scope.firstname = "John";
        $scope.lastname = "Doe";
    });
</script>
<script>
    var _mtm = window._mtm = window._mtm || [];
    _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src='{YOUR_CONTAINER_URL}'; s.parentNode.insertBefore(g,s);
</script>
</body>
</html>

@Starker3
Copy link
Author

@AltamashShaikh I'll ask the user if they have any public facing sites that we can try test this on.

@AltamashShaikh
Copy link
Contributor

He everyone this is a regression and I was able to identify the cause, will raise a PR for same to fix it

@mattoii
Copy link

mattoii commented Jun 14, 2022

@AltamashShaikh hi friend. Is Bug have been comleted? I dont see changing(

О Matomo 4.10.1, http://joxi.ru/nAyw9pbH9z94ym , http://joxi.ru/J2bG3xDTq6qlBA

@AltamashShaikh
Copy link
Contributor

Hey @mattoii It will be fixed with Matomo 4.11
4.11-rc1 is released already

@mattoii
Copy link

mattoii commented Jun 15, 2022

Hey @AltamashShaikh. We installed Matomo 4/11, but preview whatever with error. What i do wrong?

image

image

@AltamashShaikh
Copy link
Contributor

AltamashShaikh commented Jun 15, 2022

@mattoii Can you check if the following file(plugins/TagManager/vue/src/Debugging/Debugging.vue) has identical content on your instance?
File for comparison
https://github.com/matomo-org/tag-manager/blob/4.x-dev/vue/src/Debugging/Debugging.vue

@mattoii
Copy link

mattoii commented Jun 15, 2022

@AltamashShaikh yes, what else can i check?

image

@AltamashShaikh
Copy link
Contributor

@mattoii is there any way I can test it?

@AltamashShaikh
Copy link
Contributor

@mattoii The fix is with 4.11 we completed the fix a bit late due to which its not available in 4.11-rc1 branch.
If you want to test it you might have to update the TagManager plugin to latest code and regenerate the container.

@mattoii
Copy link

mattoii commented Jun 22, 2022

@AltamashShaikh we already installed last version TM
image

and we created new tag and installed it.
image

and debug still crashed
image

We need to waiting new version TM or i do wrong?

@AltamashShaikh
Copy link
Contributor

@mattoii you have upgraded to 4.11-rc1 which doesn't have this fix, btw how do you update Matomo ?
If via git you can do following things.

  1. cd plugins/TagManager/;
  2. git checkout 4.x-dev; git pull;
  3. cd ../../;
  4. ./console tagmanager:regenerate-released-containers

@mattoii
Copy link

mattoii commented Jun 23, 2022

@AltamashShaikh hi, we updated it through web interface
image

Is this enough or should I do something else?

@AltamashShaikh
Copy link
Contributor

Hey @mattoii
Its 4.11-rc1 the fix is in 4.11 and 4.11 should release next week and you can update using the above method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants