Next.js "Can't resolve 'react-native'" #372
Replies: 3 comments 1 reply
-
This did not solve it but gave me some further insights.
|
Beta Was this translation helpful? Give feedback.
-
Adding I've tried to transpile '../src' and '../src/index', without luck. |
Beta Was this translation helpful? Give feedback.
-
Replied in #376 |
Beta Was this translation helpful? Give feedback.
-
I've recently kickstarted a project in hopes to create a shared UI library for Next.js and React Native.
Everything worked fine when using Expo web that ships with react-native-builder-bob. However, when changing that to a Next.js project, I'm getting the error
Can't resolve 'react-native'
when importing my components from the lib, with the path being../src/components/Box/index.tsx
It is worth noting that when importing anything from 'react-native' directly within ./example, it works fine - it is just when importing from the library.
babel.config.js, metro.config.js and webpack.config.js are unchanged.
next.config.js
Am I missing some config to either the root lib or my example dir project?
Beta Was this translation helpful? Give feedback.
All reactions