question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XMLSerializer is not a constructor/is undefined

See original GitHub issue

🐛 Bug Report

While trying to test a class that uses XMLSerializer, I get the error ‘XMLSerializer is not a constructor’ or ‘XMLSerializer is undefined’. I have testEnvironment set to jsdom just in case.

To Reproduce

Add new XMLSerializer(); to a test.

Expected behavior

XMLSerializer should work as expected. Support for it was added to jsdom in v13.

Link to repl or repo (highly encouraged)

https://repl.it/@ChrisPaton/DarkredShinyOutliers

Environment:
  OS:  macOS 10.14.2
  Node:  8.12.0
  Yarn:  1.12.3
  npm:  6.4.1
  Watchman:  Not Found
  Xcode:  Not Found
  Android Studio:  Not Found

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
thymikeecommented, Dec 19, 2018

You’ll need to use custom jsdom environment, like this one, to use that, as jsdom dropped Node 6 in v12 and we can’t go with that currently.

0reactions
github-actions[bot]commented, May 12, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XMLSerializer is undefined in jest test - Stack Overflow
I've currently used a wrapped for XMLSerializer as below (typescript code): export default class XmlSerializerWrapper { private serializer: ...
Read more >
XMLSerializer - Web APIs | MDN
The XMLSerializer interface provides the serializeToString() method to construct an XML string representing a DOM tree.
Read more >
XmlSerializer Class (System.Xml.Serialization) | Microsoft Learn
Serializes and deserializes objects into and from XML documents. The XmlSerializer enables you to control how objects are encoded into XML.
Read more >
4.3 Dependencies - Spring
If there is no potential for ambiguity in the constructor arguments of a bean ... Find below a small part of a Spring...
Read more >
fast-xml-parser - npm
Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback. Looking for maintainers....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found