Open brownieboy opened 1 year ago
Moving to metro
Managed to get it working by adding watchFolders. Here is my config example:
const config = {
watchFolders: [path.join(__dirname, '..', '..')],
resolver: {
unstable_enableSymlinks: true,
unstable_enablePackageExports: true,
},
};
@uxigene,
watchFolders: [path.join(__dirname, '..', '..')],
Many thanks! Yes, that worked for me too š, although I'm not sure why that works š¤.
You need to add the path import at the top of the file (metro.config.js) too, of course:
const path = require('path');
This doesn't seem to work for me, same error as the above on android, even after clearing builds, cache etc, @brownieboy @uxigene please can you update the repo with the working builds.
Also, can you please say specifically what node version, pnpm version you are using.
It seems very flaky.
For those using Expo SDK 50 + RN 0.73 with pnpm, it seems there are other file resolution issues too:
Description
I have PNPM working with the new, experimental symlink support in RN 0.72.3. But it only works for me for a single RN package in a repo. It doesn't work for me in a Monorepo set up.
In my monorepo
pnpm ios
from the apps/app1 folder throws this error:pnpm android
throws this error:react-native
is in the apps/app1/node_modules folder, although it's a symlink (which is how PNPM works). That android/settings.gradle file also is there, and not as a symlink this time.React Native Version
0.72.3
Output of
npx react-native info
npx react-native info info Fetching system and libraries information... System: OS: macOS 13.3.1 CPU: (8) arm64 Apple M1 Memory: 68.48 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.9.0 path: ~/Library/Caches/fnm_multishells/87821_1689716195576/bin/node Yarn: version: 1.22.19 path: ~/Library/Caches/fnm_multishells/87821_1689716195576/bin/yarn npm: version: 8.19.1 path: ~/Library/Caches/fnm_multishells/87821_1689716195576/bin/npm Watchman: version: 2023.06.12.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.12.1 path: /Users/michaelbrown/.rvm/gems/ruby-3.0.0/bin/pod SDKs: iOS SDK: Platforms:
Steps to reproduce
Add new file, pnpm-workspace.yaml at root repo level:
That file is required for PNPM monorepo support, as PNPM does not use the
packages
field in the package.json.Run
pnpm i
to (re)install the dependencies.Enable the experimental symlink support in file apps/app1/metro.config.js:
Snack, code example, screenshot, or link to a repository
https://github.com/brownieboy/test-rn72-pnpm-monorepo