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

[BUG] @microsoft/applicationinsights-web: TypeError: Right side of assignment cannot be destructured #2350

Open
jmyrland opened this issue May 22, 2024 · 7 comments

Comments

@jmyrland
Copy link

Description

Upgrading @microsoft/applicationinsights-web from 3.1.2 vs 3.2.1, we get the following error only on MAC/OS X devices - when using app insights with React.

TypeError: Right side of assignment cannot be destructured

Rolling back to 3.1.2 fixes this issue.

Steps to Reproduce

  • OS/Browser: Safari 17
  • SDK Version [e.g. 22]: ?
  • How you initialized the SDK: ?

Key dependencies for reproduction:

    "@microsoft/applicationinsights-react-js": "17.2.0",
    "@microsoft/applicationinsights-web": "3.2.1",
    "react": "18.3.1",
    "vite": "5.2.11",

Additional context

Add any other context about the problem here.

@Karlie-777
Copy link
Contributor

Is your application behind firewall? the one major feature added in 3.2.1 is https://github.com/microsoft/ApplicationInsights-JS?tab=readme-ov-file#service-notification

@jmyrland
Copy link
Author

IDK, but we're hosting the app in an Azure app service. Might be something there by default.

Seems weird to me that this will cause issues only on Safari? The app works fine on windows using chrome, but throws this error in Safari.

@Karlie-777
Copy link
Contributor

Karlie-777 commented May 30, 2024

do you mind trying the following configs for 3.2.1

{
    connectionString: "YOUR_CONNECTION_STRING",
    ...
    extensionConfig: {
            ["AppInsightsCfgSyncPlugin"]: {
                cfgUrl: ""
            }
    }
}

does the Safari still have the same issue?

@jmyrland
Copy link
Author

It seems that this magical config fixes this issue 🤯Tested using version 3.3.0.

What does this config do? Will this be patched, or do we need to keep this config?

@Karlie-777
Copy link
Contributor

This is the new extension https://github.com/microsoft/ApplicationInsights-JS?tab=readme-ov-file#service-notification we added to the web sku.
And for users/apps behind firewall, the config need to be set.
So you can keep this config for versions >= 3.2.1

@MSNev
Copy link
Collaborator

MSNev commented Jul 19, 2024

@jmyrland

Will this be patched

  • No, there will not be any patch to remove this capability

do we need to keep this config?

  • If you don't want to allow this capability then yes you will need to keep this configuration to block us.

What does this config do

  • This component was added to allow use some level of control over deployed SDK instances to react to anything that may be causing problems for our consumers without the need for us or the users to re-deploy their applications. So things like, we deployed a version where for a sub-set of users some feature doesn't work we can globally disable that feature.
  • In a future release we will also be providing a user controllable endpoint (or plan to) to let you configure configurations via remotely again without re-deploying, and that will use this same component and rather than using a single "global" endpoint you will be able to configure your own.

@jmyrland
Copy link
Author

Ok, so if I understand correctly, this specific config opts out of the feature you mentioned.

Without opting out, our apps are bricked for specific browsers (Safari on Mac OSX, all versions). So that's a deal breaker for us.

iDK if we have a special combination of dependencies causing this or if this is the case for others as well. If so, I would assume you'd get more inquiries about this.

Also, this error was thrown as part of "react router", and did not mention app insights as part of the stack trace, so it might be hard to track down this package as the culprit.

Anyways, opting out of this fixed the issue for us 👍

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

No branches or pull requests

3 participants