nandorojo/moti

moti doesn't work with Expo Web

andreibahachenka opened this issue · 2 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I've got bunch of errors in console related to framer-motion while launching Expo Web

I see that moti has framer-motion in dependencies, so I suspect that problem is here

Expected Behavior

No errors in console. Project should be launched in Web

Steps To Reproduce

No response

Versions

- Moti: ^0.21.0
- Reanimated: ~2.12.0
- React Native: 0.70.5"

Screenshots

image

image

Reproduction

no link

did you follow the expo web docs? https://moti.fyi/web#expo-web-support

Add this Babel plugin to your config for expo to work on web: @babel/plugin-proposal-export-namespace-from
As explain in Expo docs https://docs.expo.dev/versions/latest/sdk/reanimated/#web-support

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ["babel-preset-expo"],
    plugins: [
      "@babel/plugin-proposal-export-namespace-from",
      "react-native-reanimated/plugin",
    ],
  };
};