Skip to content
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

ion-js TypeError: Failed to convert parameter ... to Ion Binary: j_.Value.from is not a function #759

Open
m-soli opened this issue Jun 20, 2023 · 2 comments
Labels

Comments

@m-soli
Copy link

m-soli commented Jun 20, 2023

With latest esbuild release - deploying a cdk application that uses esbuild to bundle typescript before deplying lambda code for
a QLDB client service. Facing following error on execute transaction function from AWS qldb nodejs driver typescript: j_.Value.from is not a function.

After tracing found:
It is coming from ion-js Value type.

Something changed between v0.17.18 and latest esbuild that cdk uses by default. Making compiling the ion-js typescript code not properly build the relevant Javascript object.

After locking the esbuild version to 0.17.18 the code compiled correctly.

Uncertain but suspect it has something to do with namespace, interface and class declarations for Value here: https://github.com/amazon-ion/ion-js/blob/master/src/dom/Value.ts

@m-soli m-soli added the bug label Jun 20, 2023
@desaikd
Copy link
Contributor

desaikd commented Jun 21, 2023

Can you please provide more context here? What is the typescript version as well as ion-js version being used? If you can also provide a minimal example of how ion-js is being used here that would be helpful.

@m-soli
Copy link
Author

m-soli commented Jul 6, 2023

Can you please provide more context here? What is the typescript version as well as ion-js version being used? If you can also provide a minimal example of how ion-js is being used here that would be helpful.

Versions: from package.json
"ion-js": "^4.3.0"
"typescript": "~5.1.3"

ion-js wasn't used directly but part of the amazon-qldb-nodejs-driver

the error is raised here from trying to dumpBinary
https://github.com/awslabs/amazon-qldb-driver-nodejs/blob/master/src/Transaction.ts#L141

This occurred when using latest esbuild version to deploy the cdk app that talks to qldb
but when locking esbuild to v0.17.18 it works fine

making me suspect a typescript build issue for the Value interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants