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

Included version of zone.js removes Promise.withResolvers #649

Open
ajaffie opened this issue Jul 29, 2024 · 3 comments
Open

Included version of zone.js removes Promise.withResolvers #649

ajaffie opened this issue Jul 29, 2024 · 3 comments
Labels
bug Report a bug

Comments

@ajaffie
Copy link

ajaffie commented Jul 29, 2024

Description

Promise.withResolvers is broken by the included version of zone.js via @opentelemetry/context-zone.

See open-telemetry/opentelemetry-js#4354 for details.

Steps to reproduce

In an app with @grafana/faro-web-tracing 1.8.2, type Promise.withResolvers in the console.

Expected behavior

It is a function.

Actual behavior

It is undefined.

Environment

  • SDK version: 1.8.2

Context

For a workaround, I added the following to my package.json:

"overrides": {
  "@grafana/faro-web-tracing": {
    "@opentelemetry/context-zone": "1.25.1"
  }
}

I'm not sure if this is going to have any unwanted side-effects yet.

@ajaffie ajaffie added the bug Report a bug label Jul 29, 2024
@codecapitano
Copy link
Collaborator

@ajaffie with Faro 1.10.0 we updated the all otel deps.
Does this solve your issue?

@adamk9k
Copy link

adamk9k commented Feb 24, 2025

I can confirm that it works with the latest 1.13.3 version however I had to manually pin the zone.js version in my package.json like so

"overrides": {
     "zone.js": "0.14.3"
   }

This is the version that includes the fix for the Promise.withResolvers() removal angular/angular#53630

@codecapitano
Copy link
Collaborator

@adamk9k @ajaffie

Heads up: with the next Faro release we don't include ZoneContextManager anymore.
It's causing problems very often and it's not needed by the default otel instruments we add.

Context manager is of course injectable via the web-tracer config.

 initializeFaro({
   instrumentations: [
     // ...
     new TracingInstrumentation({
       contextManager: new ZoneContextManager(),
     })
 ]

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

No branches or pull requests

3 participants