Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
34 votes
5 answers
17k views

Sharing a typescript library in a monorepo

I'm trying to setup a monorepo with 3 services sharing some library code. This is the current situation: repo: web pdf/ package.json reference to shared-ts using github url tsconfig.json ...
Corentin S.'s user avatar
  • 5,920
18 votes
2 answers
1k views

Share codebase using common Sdk module in create react app Reactjs application

I want to start a new app that will have both web and reactnative interfaces. I decided to move all business -non enviroment dependent- code into a third package -aka sdk- that i can share between ...
Momen Zalabany's user avatar
16 votes
3 answers
25k views

tsconfig.json shows error: Entry point for implicit type library 'glob'

I have a Monorepo which uses Typescript. I have a common folder which shows this error on the top of the file -> Entry point for implicit type library 'glob'. I am not sure what is wrong with the ...
Joshua's user avatar
  • 1,343
10 votes
0 answers
860 views

How do you share uncompiled typescript between React Native and Next.js in a monorepo?

I have settled a monorepo with Lerna and Yarn Workspaces with this structure: project | - packages | - ReactNativeApp | - NextJsApp | - FirebaseCloudFunctions | - Common | - ...
Xiiryo's user avatar
  • 3,207
7 votes
3 answers
7k views

React-native, monorepo: Unable to resolve module @babel/runtime/helpers/interopRequireDefault

I've set up a react-native app as workspace in a monorepo. I did this because I want to share some react components I've created between my mobile and web apps. The basic structure of my repo is: ...
Jim B.'s user avatar
  • 4,654
6 votes
1 answer
6k views

Expo: Cannot resolve entry file: The `main` field defined in your `package.json` points to a non-existent path

I am working with the default typescript template generated from the command line npx create-expo-app -t expo-template-blank-typescript and I get this error when I try to start the project. The main ...
TOPKAT's user avatar
  • 7,989
6 votes
1 answer
956 views

react-native cannot find node_modules that exists. this probably only occurs when I use yarn workspaces

In order to add it I ran the following command: yarn workspace mobile add react-native-webview I literally have looked in the node_modules folders that is specific by the error below and react-...
Kurnal saini's user avatar
5 votes
6 answers
7k views

React native monorepo with PNPM

My goal I am trying to use React native monorepo with PNPM, because I need performance of pnpm. Expected I should be able to bundle React native app with pnpm android and start development server with ...
Petr Špác's user avatar
4 votes
1 answer
4k views

React Native in yarn workspaces not resolving external packages

I am using yarn workspaces to create monorepo for react and react-native. I tried to add redux to @app/common and it works fine with react, but it is not resolving in native. You can see the source at ...
Faisal Manzer's user avatar
4 votes
1 answer
2k views

Monorepo with Expo and Multiple Entry Points

I have two Expo (React Native) apps that share most of their code and are already in production. We are trying to move them to a monorepo directory structure as follows: lerna.json package.json ...
Sebastian Garrido's user avatar
4 votes
0 answers
180 views

How to use shared assets between react and react-native in nxWorkspace

I have a nxWorkspace with React, React-Native and Nodejs. I've create a shared assets library to use between React and React Native. I'm able to use it with React, but I have no idea how to use it in ...
Shadab Faiz's user avatar
  • 2,450
4 votes
1 answer
5k views

How to fix "Support for the experimental syntax 'classProperties' isn't currently enabled" error if it has been already enabled?

Im building a crossplatform monorepo application for Web, Android and iOS from this example https://github.com/brunolemos/react-native-web-monorepo and when I added React Native Base to my project I ...
Max Lyaskovskiy's user avatar
3 votes
1 answer
1k views

Fix auto-imports in TypeScript monorepo

I am trying to set up a monorepo as I thought sharing common code is a great idea in an ecosystem of applications as they have a lot of common types, logic and functions. My repo includes a React ...
TheWhiteFang's user avatar
3 votes
1 answer
595 views

"Unable to resolve module ./src/main" when building a react-native app from an NX monorepo after installing Expo

What I'have done Created a NX monorepo with the react-native preset yarn add expo from workspace directory added metro dependency manually to package.json in the react native app directory pod ...
DxW's user avatar
  • 1,554
3 votes
0 answers
584 views

Failure to install node modules within react native app in a mono repo using pnpm

i'm attempting to run a react native app in a monorepo using pnpm. I added it to pnpm-workspace.yaml file defined as: packages: - "apps/*" When i attempt to run npm i or pnpm i i kept ...
EI-01's user avatar
  • 1,085
3 votes
0 answers
1k views

How to share tailwindcss preset in nx monorepo

I'm trying to share tailwindcss preset between both react and react-native apps in tx monorepo. Preset is stored in .js file located in root nx library named "tailwind". While importing ...
Jakub Jarząbek's user avatar
3 votes
0 answers
1k views

Configure metro.config of yarn workspaces monorepo containing multiple apps and packages

How can I configure the metro.config.js of a monorepo containing multiple apps (in <root>/apps/) and packages (in <root>/packages/) to work for all apps in the monorepo? Each app has its ...
gusti's user avatar
  • 495
3 votes
0 answers
281 views

Webpack loader problem when importing React component in yarn workspaces

I am setting up a next and expo project in a monorepo with yarn workspaces. I always get the following error when trying to run a page with a component exported from another yarn workspace package: ...
Max's user avatar
  • 877
3 votes
0 answers
2k views

How to properly configure jest unit and component tests in React Native monorepo with TypeScript

So, my issue is a bit difficult to descibe because our repository (which is at work, so I unfortunately can't just provide a link to it) is pretty big and complex, but I'll do my best. First of all, ...
TheWirv's user avatar
  • 31
3 votes
0 answers
1k views

React Native App In Yarn Workspace Monorepo

I have an existing app built using react native v0.61.5 as well as a website built using React and Next.js. There's lots of configuration already built into both projects for CI/CD through GitLab and ...
Scott K.'s user avatar
  • 311
3 votes
0 answers
469 views

NextJS - React-Native monorepo with react-native-elements

I'm trying to use react-native-elements in a react-native monorepo. It works fine in the Native App, but not in the NextJS Application. First, it compiles successfully: > with-react-native-web@ dev ...
ppressl's user avatar
  • 31
3 votes
0 answers
410 views

Monorepo - to get images inside packages on the root (react native)

I'm having an issue getting the images of a package with yarn monorepo with React Native. I import the image on my package but when I going to use the package on the component of the root project, the ...
virginiarcrz's user avatar
2 votes
1 answer
1k views

Unable to configure mobx in monorepo (using yarn workspaces)

I am trying to setup a monorepo with react and react native app using a yarn workspaces. My problem is with mobx (and react-mobx) library. When I use it in the shared package it does not work. Here ...
David Novák's user avatar
  • 1,485
2 votes
0 answers
323 views

SyntaxError: Cannot use import statement outside a module React native - typescript

This might be a duplicate question but have already tried few similar link solutions, but it did not work for my Monorepo(lerna architecture) project, getting below error. Every modules have their ...
Neelam Pursnani's user avatar
2 votes
1 answer
419 views

Cannot read property 'setItem' of undefined for @react-native-async-storage/async-storage

Im building a yarn 3 monorepo using react native for the app. I have an app and a ui package. Inside the ui package Im using AsyncStorage to set a value like the following import AsyncStorage from &...
themaster's user avatar
  • 365
2 votes
0 answers
779 views

Why am I getting "Invalid hook call" in react monorepo

Intro I've a react monorepo, managed with lerna and yarn workspace, and there are 3 packages inside: React Native application for iOS and Android with customized Metro bundler Web application created ...
Lorenzo Imperatrice's user avatar
2 votes
0 answers
894 views

How to initialize a mono repo and create-react-app inside monorepo?

I want to initialize a monorepo, and then initialize apps inside the packages folder. I found a bunch of examples of how to do this. But, what I want to achieve is, I want to keep all the node_modules ...
Sennen Randika's user avatar
2 votes
0 answers
1k views

React-native eas-build failed android/ios on internal and production distribution

I'm working on Mac M1 Expo sdk: "^41.0.0" React-Native : "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz" eas-cli/0.22.0 darwin-x64 node-v15.14.0 expo-cli: "4....
E.D's user avatar
  • 881
2 votes
0 answers
216 views

Having issue with react-native-paper in react-native-web platform

I have followed react native paper documentation for User on the Web. When I try to serve it gave me an error https://callstack.github.io/react-native-paper/using-on-the-web.html While try to run it ...
Somit Shrestha's user avatar
2 votes
1 answer
6k views

Lerna with Yarn, TypeScript and React Native: Cannot find module '@project/common' or its corresponding type declarations.ts(2307)

The project uses Yarn, React Native, Lerna and Typescript. It is structured as a monorepo Here is the structure: project |- packages | - mobile | - src | - packages.json | - ...
Xiiryo's user avatar
  • 3,207
2 votes
0 answers
489 views

yarn-expo-workspaces with react hooks?

I feel like I was finally able to setup my expo monorepo using expo-yarn-workspaces until I encountered the following error: Invariant Violation: Hooks can only be called inside the body of a ...
user3376065's user avatar
  • 1,167
2 votes
0 answers
545 views

Bundle errors when setting up react-native in monorepo

I'm having some issues setting up a new react-native project inside a yarn monorepo with workspaces. My root package.json looks like: { "name": "mono-repo", "workspaces": { "packages": [ ...
john_ryan's user avatar
  • 1,757
2 votes
0 answers
412 views

How to fix build error while using Lerna MonoRepo pattern on Android (React-Native)

While using Lerna MonoRepo I'm getting build error on Android, while there is no errors on iOS (XCode 10.2.1, Lerna 3.15.0, React-Native 0.59.9) I re-arranged the path of node_modules (took it ...
Hasan Can Buyukasik's user avatar
2 votes
0 answers
124 views

How to do Monorepo setup with react and react native apps for sharing code between them

I want to share most of react-native login with react web. I am using react-native-web package for this. importing file in from shared folder doesn't resolve to correct path. My project setup looks ...
shubham choudhary's user avatar
2 votes
2 answers
3k views

Expo: Unable to resolve module index.ts. None of these files exist

I'm trying out this template located here (https://github.com/t3-oss/create-t3-turbo). After installing the dependencies, I ran "pnpm dev" in the terminal. Expo gives this error Error: ...
Daniel Shumaker's user avatar
2 votes
1 answer
998 views

Using Expo React Native in Monorepo without Yarn

I have been trying to setup a monorepo using turborepo. I want to have a Nextjs application along with a React Native application (using Expo). I have come as far as getting everything to work using ...
Julius's user avatar
  • 31
1 vote
1 answer
2k views

React Native monorepo: TS2786: 'View' cannot be used as a JSX component

I have a monorepo with the following structure: repo/ ├─ node_modules/ ├─ package.json ├─ packages/ │ ├─ design-system/ │ │ ├─ package.json // dependencies installed in repo/node_modules ├─ apps/ │ ...
samzmann's user avatar
  • 2,506
1 vote
1 answer
3k views

Android release build crashes using react-native (0.68.2) in yarn workspaces monorepo

I am using monorepo created using Yarn Workspaces with Typescript which has a react-native (0.68.2) project (mobile folder) and a common folder which contains the common files to be shared across ...
Joshua's user avatar
  • 1,343
1 vote
1 answer
2k views

How to use React-Native components in a Nextjs App inside an Nx monorepo

I am trying to use React Native components inside an Nx monorepo. When I run the Nextjs app, it compiles successfully: info - automatically enabled Fast Refresh for 1 custom loader event - compiled ...
mohibkay's user avatar
1 vote
1 answer
3k views

Missing dependencies when using yarn workspace with React native init

I want to setup a monorepo. I init my React native project with npx react-native init myProject as the first project. (there will be more project added later) Folder structure Parent myProject ...
Huy Nguyen's user avatar
1 vote
1 answer
3k views

Should I have to use no-hoist for all packages in a monorepo with react-native-web?

I'm developing an SPA which I'm serving up using Rails and the ruby webpacker implementation. I have my client folder split up into a yarn monorepo for my web, native, and common code so I can reuse ...
aviemet's user avatar
  • 1,593
1 vote
1 answer
136 views

How to add react-native out-of-tree platforms using Gatsby and create-react-app?

We have a large react-native application and want to extend this application into a website and chrome-extension, the website and chrome extension use the same reducers, sagas and some components (...
Luke Brandon Farrell's user avatar
1 vote
1 answer
1k views

Install Expo package directly from Github

For some reason the Expo team is not updating their packages on npm and I need to install directly from their Github repo. The packages are in the packages/package-name folders on the main Expo ...
user473453's user avatar
1 vote
1 answer
138 views

Unable to import component from library inside application Nx Expo React Native

I'm working with an Nx monorepo that includes an Expo React Native app and several libraries. I've run into a problem where importing a component from a library within the application results in Error:...
yuuval's user avatar
  • 13
1 vote
0 answers
62 views

how to detect current project using a library in nx monorepository

I have an NX mono-repository including three apps(2 react websites and 1 mobile application) and some shared libraries. How can I detect which application I am in, in one of the shared libraries codes?...
Leila Saeedy's user avatar
1 vote
0 answers
163 views

How to access directory or file outside of root directory in React Native

I am working on project that involves creating a mobile app and website, so I decide to create same or shared screen (pages) for both my app and website. So I decided to go with this file structure. ...
Ashish Devashi's user avatar
1 vote
1 answer
873 views

BUILD FAILED : 0.72.4 main.jsbundle does not exist

I am working on monorepo-turborepo with reactnative-expo app as a one of the apps in the monorepo when i try to build the react-native app I got this error (expo:49.0.7, react-native:0.72.3) [...
Karam Jabareen's user avatar
1 vote
0 answers
214 views

Monorepo shared common function for firebase

I have init a monorepo which has the following structure. Some of the functions from firebase need to be shared. Therefore I decide to put them in the package/utils repo. I need to pass down the ...
tcf01's user avatar
  • 1,749
1 vote
0 answers
410 views

How to use shared assets between react and react-native in nx project

I have been using Nx with angular but now decided to migrate to reactjs and react-native. I have tried different answers to share images from the shared library to my react native app. This does not ...
Blaque_Mani's user avatar
1 vote
1 answer
2k views

How to properly add Expo to an existing react-native app within an NX monorepo?

I have a NX monorepo with a react native app. I need to install expo (cause I need to use some libs like ExpoAV) to the app, should I run yarn add expo at the workspace level or at the react-native ...
DxW's user avatar
  • 1,554