nandorojo / moti

🐼 The React Native (+ Web) animation library, powered by Reanimated 3.
https://moti.fyi
MIT License
3.91k stars 120 forks source link

Can't resolve 'react-native-reanimated' in @motify/core #170

Closed IlyaTaidi closed 2 years ago

IlyaTaidi commented 2 years ago

image Things I have tried. Reinstalling Different versions of Moti/Expo Reinstalling NodeModules Changing The babel.config installing reanimated (and its dependencies) directly via npm

Still getting the same error. Web view, native works just fine

nandorojo commented 2 years ago

did you follow the web docs?

IlyaTaidi commented 2 years ago

Yea, I've followed both this guide https://moti.fyi/installation, as well as this, https://moti.fyi/web. I've re-installed everything multiple times, using npm, yarn, cleaning cache/restarting multiple times. initially encountered the app just creating and trying to serve the template on web. Heres the problem repo https://github.com/IlyaTaidi/motiPl2

IlyaTaidi commented 2 years ago

Any luck?

nandorojo commented 2 years ago

When following up, keep in mind that this is open source and free work.

try

yarn why react-native-reanimated

nandorojo commented 2 years ago

your webpack file is also missing @motify. maybe try specifying @motify/core and @motify/components there

IlyaTaidi commented 2 years ago

Thanks for the follow up. I didn't mean to rush you or anything, I appreciate your work and am really jazzed to use Moti in my new project.

Heres what happens when I ran yarn why image I added the modules you suggested but I'm fairly new to webpack, assuming this syntax is correct, the project still throws the same errors

image

IlyaTaidi commented 2 years ago

I appreciate your time and effort helping with this. I've updated the problem repo with these changes

IlyaTaidi commented 2 years ago

I don't know how, but I fixed it. For some reason these packages do NOT work together : "dependencies": { "@babel/preset-env": "^7.1.6", "expo": "~44.0.0", "expo-status-bar": "~1.2.0", "moti": "^0.17.1", "react": "17.0.1", "react-dom": "17.0.1", "react-native": "0.64.3", "react-native-gesture-handler": "*", "react-native-reanimated": "~2.3.1", "react-native-web": "0.17.1" }, "devDependencies": { "@babel/core": "^7.12.9", "@expo/webpack-config": "^0.16.18", "@types/react": "~17.0.21", "@types/react-native": "~0.64.12", "typescript": "~4.3.5" },

But this configuration DOES work

"dependencies": {
"expo": "^44.0.0",
"moti": "^0.17.1",
"react": "17.0.2",
"react-dom": "^16.13.1",
"react-native": "0.64.3",
"react-native-gesture-handler": "~2.1.0",
"react-native-reanimated": "2.3.1",
"react-native-screens": "~3.10.1",
"react-native-web": "^0.15.5"

}, "devDependencies": { "@babel/core": "^7.12.9", "@expo/webpack-config": "~0.16.2", "@types/react": "~17.0.21", "@types/react-native": "~0.64.12", "typescript": "~4.3.5" },

I don't think the issue was related to webpack like I originally thought and rather was an issue with react-native-reanimated

IlyaTaidi commented 2 years ago

I don't know what the issue is, but following the same install directions the normal Expo starter still doesn't work but this does. Maybe update the starter project?

nandorojo commented 2 years ago

seems like a reanimated babel issue with 2.3.2