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

Add Next support #13

Closed thefinnomenon closed 2 years ago

thefinnomenon commented 2 years ago

I have been trying to add a package for Next.js but am running into two issues.

  1. The Next app starts and runs fine except it doesn't show the image from the app. image

  2. At some point when I setup the Next package, it breaks the other web based packages; web, browser-ext, and electron. When I try to run them I get the following error,

    
    Failed to compile.

../core/src/App.tsx Module not found: Can't resolve 'react-native' in '//packages/core/src'



There were some other annoying things like Next seemingly refusing to inject _DEV_ and a weird error about hook usage but I came up with solutions for those.

Sorry if you aren't interested in using Next but figured I would see if you have any insight -- this monorepo stuff is so confusing 😖.

Here is the working branch https://github.com/thefinnomenon/universal-project-template/tree/feat-next