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

'serialize' is not exported by node_modules/borsh/lib/index.js in 0.7.0 #135

Open
mikemaccana opened this issue Mar 20, 2023 · 1 comment

Comments

@mikemaccana
Copy link

mikemaccana commented Mar 20, 2023

Attempting to use a package that does

import { serialize, deserialize, deserializeUnchecked } from 'borsh';

The error:

Error: 'serialize' is not exported by node_modules/borsh/lib/index.js

is returned. I did try and look inside node_modules/borsh/lib/index.js but there seems to be some kind of custom universal JS module polyfill going on which makes it hard to see if the ES export exists.

@mikemaccana
Copy link
Author

Might have worked around it, looks like borsh may not actually have an ESM export, so used "@rollup/plugin-commonjs"; to allow it to be imported.

Adding native ESM support in the version distributed on npm, would be good, but you can close this if you prefer. Thanks for reading and making borsh! ❤️

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

No branches or pull requests

1 participant