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

Can't import properly in Vue 2.x app #6

Open
tgarm opened this issue Oct 21, 2021 · 1 comment
Open

Can't import properly in Vue 2.x app #6

tgarm opened this issue Oct 21, 2021 · 1 comment

Comments

@tgarm
Copy link

tgarm commented Oct 21, 2021

I'm trying to use chia-utils in Vue 2 app, code looks like this in main.js:

import { puzzle_hash_to_address } from 'chia-utils'

The error message in browser (Firefox) is:
Uncaught TypeError: window.Buffer is undefined chia-utils.js:9863

I guess it was because in Vue 2.x, window object only accessible after mounted, but chia-utils tried to access window.Buffer just inside import initialization code.
Any way to solve this?

Thank you.

@CMEONE
Copy link
Owner

CMEONE commented Nov 21, 2021

We don't use ES6 imports (import ... from ...). Please reference our install instructions and try the NPM import. If that import doesn't work, you can try the browser import instead. Please let us know if using one of these two imports solves the issue.

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

2 participants