Getting **non-serializable** errors when setting user context with Ember

I’m using Ember 3.7.0 with Sentry 5.7.1.

I’ve followed the CDN inclusion path process and properly setup sentry using an init call in my app.js.

I’ve set the user context like this:

Sentry.setUser({
                "email": "email@email.com",
                "username": "usernameHere"
            });

However when an issue is reported, the user context comes across like this:

"user":{"0":"*","1":"*","2":"n","3":"o","4":"n","5":"-","6":"s","7":"e","8":"r","9":"i","10":"a","11":"l","12":"i","13":"z","14":"a","15":"b","16":"l","17":"e","18":"*","19":"*"

Which is **non-serializable**.

What am I doing wrong?

Hey,

This is very odd.
Is this exactly your code you are passing to setUser?
Are you using our ember integration?

Yes, well I made the values more generic for this posting. Here is an example of my init in app.js:

  Sentry.init({
    environment: config.environment,
    environments: [...redacted...],
    beforeSend: (event) => {
      return ["test"].includes(config.environment) ? null : event;
    },
    dsn: '...redacted...',
    integrations: [new Sentry.Integrations.Ember()],
    appVersion: config['ember-cli-app-version']['version'],
    release: config['ember-cli-app-version']['version'],
    whitelistUrls: [
      ...redacted...
    ]
  });

and here’s what I’m including in index.html:

    <!-- <script src="https://browser.sentry-cdn.com/5.7.1/bundle.es6.min.js" integrity="sha384-h+FyW7fMq0eyUQeRnmnwiWXMxycy0z8n5sOtIH3NJx5GfqxdletL62letiWALtKy" crossorigin="anonymous"></script> -->
    <script src="https://browser.sentry-cdn.com/5.7.1/bundle.min.js"
      integrity="sha384-KMv6bBTABABhv0NI+rVWly6PIRvdippFEgjpKyxUcpEmDWZTkDOiueL5xW+cztZZ" crossorigin="anonymous">
    </script>

    <!-- If you include the integration it will be available under Sentry.Integrations.Ember -->
    <script src="https://browser.sentry-cdn.com/5.7.1/ember.min.js" crossorigin="anonymous"></script>

And you call to setUser is really just two strings or are you passing a complext user object?

Yes. I copy / pasted the code into the initial comment above and edited the values from
value + “string”

to simple string values above so that I could obscure some private information but yes, it evaluates to a string.

I would need a small repro example for this since I am not able to reproduce this. If you can provide a minimal example to try, we can take a look what’s going on.