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

When RUM is used alongside xmldom package: Identifier <obfuscated> has already been declared #3164

Open
WilHall opened this issue Nov 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@WilHall
Copy link

WilHall commented Nov 25, 2024

Describe the bug

After building a vite project with @datadog/[email protected], @datadog/[email protected], and @xmldom/[email protected], loading the transpiled javascript bundle in the browser yields the following fatal error:

index-CSY3qgmv.js:1652 Uncaught SyntaxError: Identifier <obfuscated> has already been declared

Minimal reproduction project here: WilHall/datadog_rum_vite_issue_repro

Switching from @datadog/[email protected] to the slim version @datadog/[email protected] appears to resolve the issue.

Relevant Packages

@datadog/browser-logs: ^5.20.0
@datadog/browser-rum: ^5.20.0
@xmldom/xmldom: ^0.9.5

To Reproduce

Steps to reproduce the behavior:

Minimal reproduction project here: WilHall/datadog_rum_vite_issue_repro

  1. Create a new vite project with the Relevant Dependencies listed above
  2. Run vite build (should be successful)
  3. Run vite preview (should be successful)
  4. View the preview URL in your browser and open the console
  5. You should see the error Uncaught SyntaxError: Identifier <obfuscated> has already been declared
  6. Note: In my testing, the un-obfuscated identifier appears to be getTextContent

Expected behavior

I would expect that the installation of @datadog/[email protected] would not cause this issue when used alongside @xmldom/[email protected], similar to the behavior of @datadog/[email protected].

Since it only happens with @datadog/[email protected] I'm assuming this is somehow related to the inclusion of the session replay feature.

@WilHall WilHall added the bug Something isn't working label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant