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

Async SVG files could not be loaded when the zone.js is present as peer dependency #55634

Open
csfeijo opened this issue May 2, 2024 · 2 comments
Labels
area: zones needs reproduction This issue needs a reproduction in order for the team to investigate further
Milestone

Comments

@csfeijo
Copy link

csfeijo commented May 2, 2024

Which @angular/* package(s) are the source of the bug?

zone.js

Is this a regression?

No

Description

Async files was not loaded when the zone.js is present in the same project.

Inside the file: zone.js:~1712 when the globalZoneAwareCallback is commented the async files could be loaded again:

  // global shared zoneAwareCallback to handle all event callback with capture = false
  const globalZoneAwareCallback = function (event) {
      //return globalCallback(this, event, false);
  };

In my another library the SVG files are loaded with this approach:

  const { [assetName]: asset } = await import(`@sicredi/react-assets/dist/images/index.esm.js`);

So, basically some error occurs and the file is not loaded because the zone.js XHR/Event prototyping.

We are not using the zone.js directly in the project, we are using the "@grafana/faro-web-tracing" dependency, that´s load the "@opentelemetry/context-zone", and filanny this last one uses the "zone.js" dependency to work.

Here some UI examples with the code NOT commented and commented respectivelly:

*Zone.js native code - (globalZoneAwareCallback not commented)
image

*Zone.js native code - (with globalZoneAwareCallback commented)
image

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

React 17.0.2
Node: 14.21.3
Package Manager: npm 6.4.18
OS: Windows64 / Linux 64

Project using "@grafana/faro-web-tracing" => "@opentelemetry/context-zone" => "zone.js"

Anything else?

In resume if I only import the zone.js directly in my project, the SVG Loading using the async import does´t working. I mean, isn´t necessary import the "@grafana/faro-sdk" to reproduce this issue.

No response

@ngbot ngbot bot added this to the needsTriage milestone May 2, 2024
@JeanMeche JeanMeche added the needs reproduction This issue needs a reproduction in order for the team to investigate further label May 2, 2024
@ngbot ngbot bot modified the milestones: needsTriage, Backlog May 2, 2024
@JeanMeche
Copy link
Member

Hi, could you provide a stackblitz or a github repo that reproduces the issue. That would help for the investigation of the issue, thank you.

@alan-agius4 alan-agius4 changed the title Async SVG files could not be loaded when the zone.js is present as peed dependency Async SVG files could not be loaded when the zone.js is present as peer dependency May 2, 2024
@csfeijo
Copy link
Author

csfeijo commented May 2, 2024

Hi, could you provide a stackblitz or a github repo that reproduces the issue. That would help for the investigation of the issue, thank you.

I will do that, it´s a internal project but I will create a sample on my github to simulate the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: zones needs reproduction This issue needs a reproduction in order for the team to investigate further
Projects
None yet
Development

No branches or pull requests

2 participants