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

Emurgo: TexDecoder is not a constructor #54

Closed
seamossonline opened this issue Nov 30, 2022 · 3 comments
Closed

Emurgo: TexDecoder is not a constructor #54

seamossonline opened this issue Nov 30, 2022 · 3 comments

Comments

@seamossonline
Copy link

Screenshot 2022-11-29 205116
textdecoder is not a constructor

I am attempting to implement @martifylabs/mesh on a Vue project. The line...

import { BrowserWallet } from '@martifylabs/mesh';

immediately starts causing issues. This one in particular, it seems like mesh.js is using TextDecoder from the cardano-serialization-library-nodejs.js in an unexpected way.

Should I be using a different version of mesh (see screenshot)? What version of Node do you recommend?

@abdelkrimdev
Copy link
Contributor

Hey, 😄 I was able to reproduce the issue on my end, and it turns out the culprit here is Vite.
Vite is loading the Node version of the CSL on Browser which is not correct.
I tried to reach out to them via Discord and with some examples, they were able to identify the bug, here is a PR
vitejs/vite#11219 which fixes the issue.
as a temporary fix, you can use Webpack instead.

@seamossonline
Copy link
Author

seamossonline commented Dec 14, 2022

Hey, 😄 I was able to reproduce the issue on my end, and it turns out the culprit here is Vite. Vite is loading the Node version of the CSL on Browser which is not correct. I tried to reach out to them via Discord and with some examples, they were able to identify the bug, here is a PR vitejs/vite#11219 which fixes the issue. as a temporary fix, you can use Webpack instead.

Awesome! That was going to be my next question -- how do you migrate a project from Vite to Webpack? I see many tutorials on the other way around, but...

@denishacquin
Copy link

Would really appreciate a fix on this :/

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

3 participants