-
Notifications
You must be signed in to change notification settings - Fork 0
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
hot reloading #1
Comments
Following this guide https://docs.expo.dev/router/installation/ resolves the hot reloading issue, with one caveat: |
Update: running expo cli from the app directory seems to be unable to resolve Getting curious now, unsure if you will have any time to answer this @lokshunhung, understandable if not but maybe myself and some others might pick something up from all this! Cheers |
Hi @medv as you've probably already figured out, to run expo commands you need to be inside the
or you can do at the root of the project using this command: (click to expand)$ pnpm --filter @lokshunhung/mobile exec expo startSee more about pnpm's filter here The idea is that you need to execute expo at the app project's root instead of the repository root directory
On the issue you're having with web, unfortunately I'm afraid that I'm unable to help you with that. I do should note that expo seems to be recommending using their metro bundler solution for web and using expo router moving forward. I think I won't be integrating that into this repository since I am in favour of using react-navigation directly and frankly not a big fan of file based routing. Feel free to fork this repository and make the required changes to use expo router. If that works for you let me know too, I am happy to link your setup in this repo's README if you wish to :) (Edit): Forgot to mention, yes hot reload (react fast refresh) works on mobile |
Thanks for the reply! Hope that clears it up. My issue is not really to do with web, but with problematic resolution with strange effects that might apply to all kinds of future work built on this solution : ( ps. I should clarify that I have a functioning nx integrated-style monorepo using pnpm that works without these issues, I would just prefer a leaner solution which yours looks to be! |
Apologies for spamming, just documenting as I problemsolve. Hope it helps at least one other person that doesn't have the full mastery of this yet like myself. ✔️ Your suggestion of using pnpm exec works, pnpx for me does not. There is a difference in resolution between the two commands it seems, with exec being able to step through the node_modules structure to find the relevant binary to call. This probably worked in a nx integrated monorepo because there was only the root node_modules, whereas here we are using pnpm workspaces properly. Simply stop using ❌ ❌ source maps of pkgs imported in the app load great on initial render, then after HMR console prints a warning saying that the sourcemap for the imported module is unable to be found. There are semi-adjacent issues in expo and metro to do with sourcemaps. It's unclear whether this monorepo causes an issue, or the issue is upstream. Probably wise to wait and see, then fix once upstream looks like it definitely works. Closing this because there are fewer issues introduced by this pattern than it seemed at first, though it is not 100% yet in the clear. If anyone does any more experimentation, or doesn't experience these issues - please give a heads up :) Thank you lokshunhung! |
Thanks for the reproduction, this does indeed work if I add @babel/runtime and react dependencies to the pkgs packages.
Does hot reloading work for you? After refreshing on web, all changes are recompiled and reflected correctly - but not during HMR for some reason. Yet to test it on native
The text was updated successfully, but these errors were encountered: