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

After bumping ReactNative project from 1.1.6 to 2.0.0 builds for Android fail #91

Closed
Overtorment opened this issue Oct 1, 2022 · 6 comments

Comments

@Overtorment
Copy link

warning: the transform cache was reset.
                    Welcome to Metro!
              Fast - Scalable - Integrated


error Unable to resolve module ./secp256k1.wasm from /home/ghost/Documents/BlueWallet/node_modules/tiny-secp256k1/lib/wasm_loader.browser.js: ./secp256k1.wasm could not be found within the project or in these directories:
Error: Unable to resolve module ./secp256k1.wasm from /home/ghost/Documents/BlueWallet/node_modules/tiny-secp256k1/lib/wasm_loader.browser.js: ./secp256k1.wasm could not be found within the project or in these directories:
  node_modules
  node_modules


If you are sure the module exists, try these steps:
If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
 4. Remove the cache: rm -rf /tmp/metro-*
> 1 | // Suppress TS2792: Cannot find module './secp256k1.wasm'.
> 1 | // Suppress TS2792: Cannot find module './secp256k1.wasm'.
    |                                         ^
    |                                         ^
  2 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  2 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  3 | // @ts-ignore
  3 | // @ts-ignore
  4 | import * as wasm from "./secp256k1.wasm";
  4 | import * as wasm from "./secp256k1.wasm";.
    at ModuleResolver.resolveDependency (/home/ghost/Documents/BlueWallet/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:129:15)
    at DependencyGraph.resolveDependency (/home/ghost/Documents/BlueWallet/node_modules/metro/src/node-haste/DependencyGraph.js:288:43)
    at Object.resolve (/home/ghost/Documents/BlueWallet/node_modules/metro/src/lib/transformHelpers.js:129:24)
    at resolve (/home/ghost/Documents/BlueWallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
    at /home/ghost/Documents/BlueWallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (/home/ghost/Documents/BlueWallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
    at processModule (/home/ghost/Documents/BlueWallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async addDependency (/home/ghost/Documents/BlueWallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
info Run CLI with --verbose flag for more details.

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

image

I looked through closed issues, and saw mentions of webpack & asyncWebAssembly for ReactNative, but iirc RN switched its bundler to Metro some time ago.

Relevant PR: BlueWallet/BlueWallet#5048

@Overtorment
Copy link
Author

ok i bumped to 2.2.1 and the error is

error While trying to resolve module `tiny-secp256k1` from file `/home/ghost/Documents/BlueWallet/class/wallets/segwit-bech32-wallet.js`, the package `/home/ghost/Documents/BlueWallet/node_modules/tiny-secp256k1/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/home/ghost/Documents/BlueWallet/node_modules/tiny-secp256k1/lib/cjs/index.cjs`. Indeed, none of these files exist:

  * /home/ghost/Documents/BlueWallet/node_modules/tiny-secp256k1/lib/cjs/index.cjs(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)

and i think i saw a solution for that in one of the closed issues. lemme go throught them and i will get back to you...

@junderw
Copy link
Member

junderw commented Oct 2, 2022

Does react Native support WASM?

@junderw
Copy link
Member

junderw commented Oct 2, 2022

Or is this Android only?

iOS builds? I wonder why... React Native supports WASM only with iOS builds?...? That doesn't make much sense...

@Overtorment
Copy link
Author

yeah i didnt look, apparently both builds failed.
i applied a fix from facebook/metro#815 (comment)
now it builds, but build crashes immediately after launch

@Overtorment
Copy link
Author

RN doesnt support wasm afaik

@junderw
Copy link
Member

junderw commented Oct 2, 2022

Yeah, just stay on the old libraries for now.

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