Skip to content

After upgrading to Vue3/Vite 8, Console Warning [INVALID_ANNOTATION] #2763

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @microsoft/applicationinsights-web@3.4.3 for the project I'm working on.

There may be more but this seems to work by removing the /*#__PURE__*/, there may be a better fix but this works fine locally.

[INVALID_ANNOTATION] A comment "/*#__PURE__*/" in "node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js" contains an annotation that Rolldown cannot interpret due to the position of the comment.
    ╭─[ node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js:33:17 ]
    │
 33 │ var HTTP_DOT = (/*#__PURE__*/"http.");
    │                 ──────┬──────  
    │                       ╰──────── comment ignored due to position
    │ 
    │ Help: For more information on how to use pure annotations correctly, check the documentation: https://rolldown.rs/in-depth/dead-code-elimination#pure

[INVALID_ANNOTATION] A comment "/*#__PURE__*/" in "node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js" contains an annotation that Rolldown cannot interpret due to the position of the comment.
    ╭─[ node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js:34:44 ]
    │
 34 │ var _MS_PROCESSED_BY_METRICS_EXTRACTORS = (/*#__PURE__*/"_MS.ProcessedByMetricExtractors");
    │                                            ──────┬──────  
    │                                                  ╰──────── comment ignored due to position
    │ 
    │ Help: For more information on how to use pure annotations correctly, check the documentation: https://rolldown.rs/in-depth/dead-code-elimination#pure
────╯

https://rolldown.rs/in-depth/dead-code-elimination#pure

Here is the diff that solved my problem:

diff --git a/node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js b/node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js
index 55e9878..a7c149b 100644
--- a/node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js
+++ b/node_modules/@microsoft/applicationinsights-web/dist-es5/internal/trace/spanUtils.js
@@ -30,8 +30,8 @@ var MessageBusDestination = "message_bus.destination";
  */
 var TIME_SINCE_ENQUEUED = "timeSinceEnqueued";
 var PORT_REGEX = (/*#__PURE__*/getLazy(function () { return new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/); }));
-var HTTP_DOT = (/*#__PURE__*/"http.");
-var _MS_PROCESSED_BY_METRICS_EXTRACTORS = (/*#__PURE__*/"_MS.ProcessedByMetricExtractors");
+var HTTP_DOT = ("http.");
+var _MS_PROCESSED_BY_METRICS_EXTRACTORS = ("_MS.ProcessedByMetricExtractors");
 /**
  * Legacy HTTP semantic convention values
  * @internal

This issue body was partially generated by patch-package.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions