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

React Native's metro bundler doesn't support dynamic imports #458

Open
markspereira opened this issue May 5, 2020 · 3 comments
Open

React Native's metro bundler doesn't support dynamic imports #458

markspereira opened this issue May 5, 2020 · 3 comments

Comments

@markspereira
Copy link

There are dynamic imports in this code which React Native doesn't support.

arc.js/src/arc.ts

Lines 325 to 327 in a411259

let artefact = require(`${ABI_DIR}/${version}/${abiName}.json`)
if (artefact.rootVersion) {
artefact = require(`${ABI_DIR}/${artefact.rootVersion}/${abiName}.json`)

@orenyodfat
Copy link
Contributor

orenyodfat commented May 5, 2020

@markspereira could you please send the error log alon with that?
could you please set up an env for reproduce that ?
is that a runtime or compilation error ?

@dOrgJelli
Copy link
Contributor

A possible solution to this would be to generate a module that imports all of the ABIs by their static paths. This is similar to what's done in the subgraph for setting contract infos.

@orenyodfat
Copy link
Contributor

yea, one option to create this file as a pre compile file..
other option will be to index the Abis in the subgraph.

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