You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XML serializer is not found unless this library is extracted in the file system. Result is failing XML serialization for example when this library is bundled or the package manager uses a linker that does not create the node_modules folder.
Discussion from referenced issue follows:
CycloneDX's XML serializer cannot find its xmlbuilder2 dependency, at least when bundled as Yarn plugin.
This defeats the idea of having the list of potential serializers in the possibleStringifiers array but as it only has 1 hard-coded option for now, making the change is an option.
Alternatively, if you want to retain the listing, you could have require calls containing constants but wrap them in functions. Then iterate over this structure and calls the functions to test for presence of serializers.
const possibleStringifiers = [
// prioritized list of possible implementations
['xmlbuilder2', () => require(`./stringifiers/xmlbuilder2`)]
]
...
for (const [serializerName, loaderFunc] of possibleStringifiers) {
try {
const possibleStringifier = loaderFunc()
....
The text was updated successfully, but these errors were encountered:
AugustusKling
added a commit
to AugustusKling/cyclonedx-javascript-library
that referenced
this issue
Feb 24, 2024
Follow-up to CycloneDX/cyclonedx-node-yarn#13 (comment)
XML serializer is not found unless this library is extracted in the file system. Result is failing XML serialization for example when this library is bundled or the package manager uses a linker that does not create the node_modules folder.
Discussion from referenced issue follows:
The text was updated successfully, but these errors were encountered: