Next.js Discord

Discord Forum

How to edit Next.Config.js to add plugins like Skia?

Unanswered
Egyptian Mau posted this in #help-forum
Open in Discord
Egyptian MauOP
We're encountering an issues on the web side while trying to run React Native Skia in NextJS as part of a Solito monorepo. Mobile (Expo) seems to work fine, but the "warning" Skia throws of not finding reanimated is causing Next.js builds to error out with the following error:

warn ../../node_modules/@shopify/react-native-skia/lib/module/external/reanimated/moduleWrapper.js Module not found: Can't resolve 'react-native-reanimated/package.json' in '/Users/apple/Documents/frontend/node_modules/@shopify/react-native-skia/lib/module/external/reanimated'

The warning above is referenced in the documents around how to set up webpack installations manually. It gives a code snippet but we are struggling to understand where to add this in our NextJS configuration. We have a suspicion it's supposed to be in the next.config.js file but don't know how to merge both code snippets to get it to work. Please find a screenshot attached of what our next.config.js file looks like so far. Any guidance of where we should add the code snippet in the help page would be immensely helpful as we are stuck not able to build NextJS. Thank you!

0 Replies