spacebudz / lucid

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
https://lucid.spacebudz.io
MIT License
336 stars 133 forks source link

vite node vue3 http://127.0.0.1:4001/node_modules/.vite/deps/cardano_multiplatform_lib_bg.wasm 404 (Not Found) #243

Open zjavax opened 4 months ago

zjavax commented 4 months ago
"lucid-cardano": "^0.10.7"

node_modules/lucid-cardano/esm/src/core/libs/cardano_message_signing/cardano_message_signing_bg.wasm node_modules/lucid-cardano/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib_bg.wasm

You need to manually copy the above two files to the following folder , which can temporarily solve this problem, but you must copy it every time

node_modules.vite\deps

cauu commented 1 month ago

It's because lucid are using fetch instead of dynamic import to install those two modules. What I've done is forking a lucid and replace default link of those two files with a CDN version.

I would recommend that lucid can give us an option to decide whether use local or remote ones, so we can easily use it in vite project. @alessandrokonrad