mmazzarolo / react-native-universal-monorepo

React Native boilerplate supporting multiple platforms: Android, iOS, macOS, Windows, web, browser extensions, Electron.
MIT License
1.7k stars 150 forks source link

Local image file .png in ./app/src folder is not showing in windows build #53

Open edcylau opened 1 year ago

edcylau commented 1 year ago

Hi all, I have a encounter an issue with my windows build, the Image cannot be shown from the ./app/src/Logo.png, just Blank and got this error from metro bundler, not sure if it's related, it's trying to resolve the my component in the node_modules and ....\node\node_modules, which does not exist there. Is it the path should be hoisted 2 more layers?

├── node_modules
├── package.json
└── packages
    ├── @my-app/app
        ├── src
                 ├── Logo.png
    ├── @my-app/macos 
    ├── @my-app/windows
Error: Unable to resolve module ./app/src/presentation/ui/MainScreen from C:\Users\<project-folder>\packages\windows/.: ./app/src/presentation/ui/MainScreen could not be found within the project or in these directories:
  node_modules
  ..\..\node_modules

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*