Project

Profile

Help

Bug #4669

SaxonJS object is empty using Webpack

Added by John Dziurlaj about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Category:
API
Sprint/Milestone:
-
Start date:
2020-08-05
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2.0
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

I am upgrading an application from Saxon 1.x to 2.0 and am running into some issues. Previously I had to modify the SaxonJS code to work with webpack, but now that 2.0 is distributed via NPM I had some hope that those customizations would no longer be necessary. However, when invoking SaxonJS.transform, I get an error that the function does not exist (the object is empty i.e. {}).

Entire codebase with WIP branch available here: https://github.com/HiltonRoscoe/CDFConverter/tree/saxonjs-upgrade

See also #4639.

History

#1 Updated by Michael Kay about 1 month ago

  • Category set to API
  • Assignee set to Debbie Lockett
  • Priority changed from Low to Normal

#2 Updated by Debbie Lockett about 1 month ago

Thanks for getting in touch to let us know about the issue. I'm afraid we don't really have experience with Webpack, but I'll investigate. As you suggest, the problem here could be the same as with the use of SaxonJS in Electron (bug #4639).

Does your application run in the browser, or in Node.js? Note that the version of Saxon-JS 2 on NPM is designed for use in Node.js only; there is a separate download for the Browser platform version, because there are internal differences. I'm not sure how this fits in with using Webpack?

#3 Updated by John Dziurlaj about 1 month ago

Yes, Webpack is designed to package code to be used on the browser side. Many npm packages are designed to work on Node or in the browser, but I take your point.

Electron is similar, there is a "web side" (the UI) that runs in Chrome, and the "node side" that provides Node functionality such as File I/O.

Please register to edit this issue

Also available in: Atom PDF Tracking page