• Resolved rosbiffer

    (@rosbiffer)


    I am getting an error message in my console on the above site of this:

    <script type="text/javascript" id="wp-data-js-after"> /* <![CDATA[ */
    ( function() {
     var userId = 2;
     var storageKey = "WP_DATA_USER_" + userId;
     wp.data
     .use( wp.data.plugins.persistence, { storageKey: storageKey } );
    } )();

    The error is in the .use line (presumably it should be .user?). It disappears when I disable ProfileGrid. Is it coming from your plugin?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ProfileGrid Support

    (@profilegrid0)

    Hello @rosbiffer,

    We checked and the error is is not related with our plugin. The code you’ve provided seems to be JavaScript code related to WordPress and the use of the?wp.data?object. The error you’re encountering might be related to various issues, and it’s hard to pinpoint the exact problem without more context or the specific error message.

    Hello, I’m getting the same error. It disappears when I disable woocommerce. In my case, users without account cannot place orders anymore. It seams that wp.data.use has been used to store some user data but it fails for guests. Could you help me?

    Hi,

    I was looking at this at the browser console and when I change the JSON body key from “storageKey” to just “storage”, the function appears to behave correctly.

    <script type="text/javascript" id="wp-data-js-after">
      /* <![CDATA[ */
      (function() {
        var userId = 0;
        var storageKey = "WP_DATA_USER_" + userId;                  
    
    wp. data.use(wp.data.plugins.persistence, {
       storage: storageKey
    });
    }
    )();
    /* ]]> */
    </script>

    …So I wonder, what is a good way to at least temporarily resolve this issue until the plugin issuer fixes it?

    Side note: this code block above comes from: data.min.js.

    Thanks.

    • This reply was modified 9 months, 3 weeks ago by wm408.

    Follow up,

    I realize there’s also a storageKey variable, but for whatever reason it is not being set. So my earlier comment that storage is the right place to put the data, is probably not right. Still not sure why this is happening.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error message in console’ is closed to new replies.