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

cashscript not working with latest version of vite #199

Open
mr-zwets opened this issue Jul 16, 2024 · 3 comments
Open

cashscript not working with latest version of vite #199

mr-zwets opened this issue Jul 16, 2024 · 3 comments

Comments

@mr-zwets
Copy link
Member

when using yarn create vue to initialize a default vue-vite app, cashscript import is broken.

first I ran into

Uncaught TypeError: class heritage import_events.EventEmitter is not an object or null

originating from

var ElectrumSocket = class extends import_events.EventEmitter {

I was able to solve this with

yarn add events

vitejs/vite#2694

but new errors pop up:

Error: Build failed with 1 error:
node_modules/cashscript/dist/utils.js:1:256: ERROR: No matching export in "node_modules/@bitauth/libauth/build/index.js" for import "bigIntToCompactSize"

and

Uncaught SyntaxError: The requested module 'http://localhost:5173/node_modules/hash.js/lib/hash.js?v=fcabd058' doesn't provide an export named: 'default'

which has the comment // TODO: Replace with libauth

@mr-zwets
Copy link
Member Author

My issue was with using CashScript + Vite version ^5.3.1

Downgrading to Vite version 5.0.12 solved the issue

@Sydwell
Copy link
Contributor

Sydwell commented Sep 3, 2024

I having a similar issue with react/next, I can get it with next version 13.... but not 14...

@mr-zwets
Copy link
Member Author

so this issue is related to #222 which has now been resolved and will be published with release v0.10.2 next week

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