cardano-serialization-lib icon indicating copy to clipboard operation
cardano-serialization-lib copied to clipboard

Vue3 + Vite fails to import

Open kinqsley opened this issue 3 years ago • 3 comments

Hello, I am trying to get this lib import for Vite

import init, { wasm } from '@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib';

But i was facing the error as follows:

image

Does anyone have idea how to import the lib for Vite & Vue3?

kinqsley avatar Nov 22 '21 05:11 kinqsley

Did you find any solution for this?

a01410207 avatar Feb 01 '22 06:02 a01410207

@emurgo/cardano-serialization-lib-browser this doesn't work with vite?

Koutelier avatar Mar 16 '22 21:03 Koutelier

I worked with this for awhile and was never able to get it to work correctly the way the Vite docs say it should. I think there's something different about the way the project is set up and the newer method for loading the WASM that vite is calling. IDK anyways there is a non-wasm js package that you can use with Vite if you're willing to give up on the WASM for now, alternatively it does work with webpack and I've done that successfully with Vue.

radflipper avatar Mar 16 '22 21:03 radflipper

It should help https://www.npmjs.com/package/vite-plugin-wasm

lisicky avatar Jun 21 '23 12:06 lisicky