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

Unable to access @example-app/shared in RN CLI #10

Open
Vikraantnegi opened this issue Jun 2, 2023 · 1 comment
Open

Unable to access @example-app/shared in RN CLI #10

Vikraantnegi opened this issue Jun 2, 2023 · 1 comment

Comments

@Vikraantnegi
Copy link

error: Error: Unable to resolve module @example-app/shared from /home/fa80mlhr3/Git/react-native-monorepo-main/packages/mobile/App.tsx: @example-app/shared could not be found within the project or in these directories:
node_modules
../../node_modules

image
image

@hdwilber
Copy link

Looks like there is something missing the metro configuration file.

  watchFolders: [
    path.resolve(__dirname, '../../node_modules'),
    path.resolve(__dirname, '../../node_modules/@example-app/shared'),
    path.resolve(__dirname, '../shared'),
  ],

Apparently, you have to watch the symlink @example-app/shared along with the target folder itself: ../shared
You can refer to this comment: facebook/metro#1 (comment)

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