Skip to content

Issues in Cloudflare worker caused by @azz/elementtree #77

@Bilal-io

Description

@Bilal-io

Cloudflare doesn't allow executing eval() or new Function() at runtime.
The dependency @azz/elementtree is calling new Function() in the @azz/elementtree/lib/sprintf.js file.

Is it possible to replace this dependency, or suggest a workaround for this issue to run in Cloudflare workers?

Here is the exception:
`EvalError: Code generation from strings disallowed for this context

(file:///D:/my-project-directory/node_modules/@azz/elementtree/lib/sprintf.js:65:16)
at exports.sprintf
(file:///D:/my-project-directory/node_modules/@azz/elementtree/lib/sprintf.js:82:5)
at null.
(file:///D:/my-project-directory/node_modules/@azz/elementtree/lib/elementtree.js:557:19)
at [object Object]
at _serialize_xml
(file:///D:/my-project-directory/node_modules/@azz/elementtree/lib/elementtree.js:543:15)
at ElementTree.write
(file:///D:/my-project-directory/node_modules/@azz/elementtree/lib/elementtree.js:346:7)
at PorticoConnector2.buildEnvelope
(file:///D:/my-project-directory/.svelte-kit/output/server/chunks/globalpayments.js:12894:54)
at PorticoConnector2.processAuthorization
(file:///D:/my-project-directory/.svelte-kit/output/server/chunks/globalpayments.js:12693:38)
at AuthorizationBuilder.execute
(file:///D:/my-project-directory/.svelte-kit/output/server/chunks/globalpayments.js:5182:69)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions