question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Expo managed workflow

See original GitHub issue

New Feature Request

Current Limitation

It appears to me that at least additional instructions are needed in order to be able to run a Expo managed workflow without compilation errors, if that’s even possible at all.

Feature / Enhancement Description

After configuring the code to run in RN environment in the following manner:

import Moralis from "moralis/react-native";
import { MoralisProvider } from "react-moralis";

const getMoralis = () => Moralis

export default function App() {
  return (
    <MoralisProvider
      environment="native"
      getMoralis={getMoralis}
      appId="dxtPXb6rRSzQnIAcgIKScHS5sxrUI0dvmgO8xiQs"
      serverUrl="https://si9oaram1zec.usemoralis.com:2053/server">

I still get the following error when trying to run a newly created expo managed project:

[00:58:05] Android Bundling failed 15409ms
[00:58:05] Unable to resolve module events from D:\projects_2021\moralis\my-app\node_modules\moralis\lib\react-native\MoralisWeb3.js:  events could not be found within the project or in these directories:
[00:58:05]   node_modules\moralis\node_modules
[00:58:05]   node_modules
[00:58:05]
[00:58:05] If you are sure the module exists, try these steps:
[00:58:05]  1. Clear watchman watches: watchman watch-del-all
[00:58:05]  2. Delete node_modules and run yarn install
[00:58:05]  3. Reset Metro's cache: yarn start --reset-cache
[00:58:05]  4. Remove the cache: rm -rf /tmp/metro-*
[00:58:05]   167 | }
[00:58:05]   168 |
[00:58:05] > 169 | var EventEmitter = require('events');
[00:58:05]       |                             ^
[00:58:05]   170 |
[00:58:05]   171 | var EthereumEvents = {
[00:58:05]   172 |   CONNECT: 'connect',

Alternatives / Workarounds

With additional configuration based on this repository it’s possible to fix some dependency errors, one important issue to overcome being the fact that managed workflow projects rely on expo-crypto instead of react-native-crypto .

3rd Party References

expo-crypto feature set support is described here: https://docs.expo.dev/versions/latest/sdk/crypto/ Expo support discussion thread: https://expo.canny.io/feature-requests/p/crypto-api Moralis + RN boilerplate: https://github.com/ethereum-boilerplate/ethereum-react-native-boilerplate

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ErnoWcommented, Jan 21, 2022

Closing this issue as it is rather an implementation issue. The recommended way to use react-native is to use https://github.com/ethereum-boilerplate/ethereum-react-native-boilerplate

Any questions or support can be asked in the forum as we are more active there with support and developers 😃

0reactions
adamsr123commented, Feb 26, 2022

@ErnoW expo is a great tool for working with react-native, I think this should be addressed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workflows - Expo Documentation
The managed workflow is kind of like Rails and Create React App, but for React Native. Developers build managed workflow apps using Expo...
Read more >
Deciding between Expo Managed & Bare Workflows - Medium
A “managed workflow” is when you let Expo handle specifying important properties through a convenient app.json, as well build your app on ...
Read more >
How To Eject From Expo Managed Workflow to Bare? - Pagepro
In the bare workflow we have full access to the underlying native projects and any native code. It's a “bare” native project with...
Read more >
Expo: React Native Simplified | Grio Blog
A managed workflow allows you to build your app for production using Expo's build service (EAS). With a managed workflow, Expo handles all ......
Read more >
Support for Expo Managed Workflow #47 - GitHub
Steps to reproduce the issue: Build a new expo managed app. Add dd-sdk-reactnative dependency (1.0.0-alpha5); Call dd- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found