-
-
Notifications
You must be signed in to change notification settings - Fork 323
TypeError when using CommonJS: XMLParser is not a constructor #719
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
Comments
2 tasks
Closed
I have the same issue using v5 with Jest. The culprit seems to be this line in /******/ module.exports.fxp = __webpack_exports__; It should actually be {
fxp: Object [Module] {
XMLBuilder: [Getter],
XMLParser: [Getter],
XMLValidator: [Getter]
}
} by importing it. |
issue is resolved will be publishing the changes soon |
done, please reopen if you still find the issue. |
ℹ I have tested 5.0.4 with the CommonJS script provided in this issue: no more error 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When using CommonJS, my application is unable to create an instance of
XMLParser
orXMLBuilder
I get errors like
TypeError: XMLParser is not a constructor
when running with node or when running tests with JestTypeError: fast_xml_parser_1.XMLParser is not a constructor
I have the same kind of error when trying to use
XMLBuilder
For example (run on Ubuntu 22.04, node v20.18.3)
Input
Here are scripts to reproduce the problem. I run them in a fresh project with a single dependency to fast-xml-parser
Code
CommonJS: not working
ESM: working
Output
CommonJS: see description at the top of this issue
expected data
Same as ESM:
Would you like to work on this issue?
The text was updated successfully, but these errors were encountered: