aleph.js icon indicating copy to clipboard operation
aleph.js copied to clipboard

Crash when importing WalletConnect

Open hazae41 opened this issue 4 years ago • 4 comments
trafficstars

When I import these two modules, Aleph.js crashes on compilation step, similarly to the crash when using circular imports (https://github.com/alephjs/aleph.js/issues/306)

import WalletConnect from "https://esm.sh/@walletconnect/client"
import QRCodeModal from "https://esm.sh/@walletconnect/qrcode-modal"

Here is the debug

> aleph dev
Check https://deno.land/x/[email protected]/cli.ts
INFO Config loaded from aleph.config.ts
TIMING load config in 142ms
TIMING init framework in 181ms
TIMING apply plugins in 0ms
INFO Compiling...
TIMING init compiler wasm in 403ms
TIMING compile '/comps/app.tsx' in 429ms
TIMING compile '/comps/ethereum/connector.tsx' in 12ms
TIMING compile '/comps/ethereum/walletconnect.tsx' in 25ms
TIMING compile 'https://esm.sh/@walletconnect/client' in 2ms
TIMING compile 'https://cdn.esm.sh/v41/@walletconnect/[email protected]/deno/client.development.js' in 15ms
TIMING compile 'https://cdn.esm.sh/v41/@walletconnect/[email protected]/deno/iso-crypto.development.js' in 33ms
TIMING compile 'https://cdn.esm.sh/v41/@pedrouid/[email protected]/deno/iso-crypto.development.js' in 190ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/crypto-browserify.development.js' in 45ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/browserify-sign.development.js' in 93ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/create-ecdh.development.js' in 97ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/diffie-hellman.development.js' in 85ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/miller-rabin.development.js' in 20ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/brorand.development.js' in 17ms
TIMING compile 'https://cdn.esm.sh/v41/[email protected]/deno/elliptic.development.js' in 511ms
>

hazae41 avatar May 15 '21 14:05 hazae41

please try alpha.33 that fixs #306

ije avatar May 15 '21 19:05 ije

Yes! It's fixed

Thanks

hazae41 avatar May 15 '21 19:05 hazae41

I have another problem now

21:52:23.955 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/hmac-drbg.js:2:23: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/hash.js
21:52:23.956 | 2 │ import __hash_js$ from "../../[email protected]/deno/hash.js";
21:52:23.956 | ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:23.956 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/create-hash.js:3:22: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/md5.js
21:52:23.957 | 3 │ import __md5_js$ from "../../[email protected]/deno/md5.js";
21:52:23.957 | ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:23.957 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/create-hash.js:2:22: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/sha.js
21:52:23.958 | 2 │ import __sha_js$ from "../../[email protected]/deno/sha.js";
21:52:23.958 | ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:23.969 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/public-encrypt.js:3:21: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/bn.js
21:52:23.969 | 3 │ import __bn_js$ from "../../[email protected]/deno/bn.js";
21:52:23.969 | ╵                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:23.970 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/browserify-rsa.js:2:21: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/bn.js
21:52:23.970 | 2 │ import __bn_js$ from "../../[email protected]/deno/bn.js";
21:52:23.970 | ╵                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:23.972 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/browserify-des.js:4:22: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/des.js
21:52:23.972 | 4 │ import __des_js$ from "../../[email protected]/deno/des.js";
21:52:23.972 | ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:23.988 | > app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/parse-asn1.js:2:23: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/asn1.js
21:52:23.988 | 2 │ import __asn1_js$ from "../../[email protected]/deno/asn1.js";
21:52:23.988 | ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:24.017 | > app/.aleph/production/-/cdn.esm.sh/v41/@walletconnect/[email protected]/deno/utils.js:6:21: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/bn.js
21:52:24.017 | 6 │ import __bn_js$ from "../../../[email protected]/deno/bn.js";
21:52:24.017 | ╵                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:52:24.104 | error: Uncaught (in promise) Error: Build failed with 8 errors:
21:52:24.104 | app/.aleph/production/-/cdn.esm.sh/v41/@walletconnect/[email protected]/deno/utils.js:6:21: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/bn.js
21:52:24.106 | app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/browserify-des.js:4:22: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/des.js
21:52:24.106 | app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/browserify-rsa.js:2:21: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/bn.js
21:52:24.106 | app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/create-hash.js:2:22: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/sha.js
21:52:24.106 | app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/create-hash.js:3:22: error: Could not read from file: /vercel/path2/app/.aleph/production/-/cdn.esm.sh/v41/[email protected]/deno/md5.js
21:52:24.106 | ...
21:52:24.106 | let error = new Error(`${text}${summary}`);
21:52:24.106 | ^
21:52:24.106 | at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1406:15)
21:52:24.107 | at https://deno.land/x/[email protected]/mod.js:1088:28
21:52:24.107 | at runOnEndCallbacks (https://deno.land/x/[email protected]/mod.js:876:63)
21:52:24.107 | at buildResponseToResult (https://deno.land/x/[email protected]/mod.js:1086:7)
21:52:24.107 | at https://deno.land/x/[email protected]/mod.js:1193:14
21:52:24.107 | at https://deno.land/x/[email protected]/mod.js:567:9
21:52:24.107 | at handleIncomingPacket (https://deno.land/x/[email protected]/mod.js:664:9)
21:52:24.107 | at readFromStdout (https://deno.land/x/[email protected]/mod.js:534:7)
21:52:24.107 | at https://deno.land/x/[email protected]/mod.js:1676:11
21:52:24.125 | Error: Command "curl -fsSL https://deno.land/x/install/install.sh \| sh -s v1.10.1 && /vercel/.deno/bin/deno run -A https://deno.land/x/aleph/cli.ts build app" exited with 1

hazae41 avatar May 15 '21 19:05 hazae41

@hazae41 I'm wondering in 0.3 beta still has this problem?

ije avatar Aug 24 '21 04:08 ije