Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings in console while running web expo #5967

Open
djaffer opened this issue May 2, 2024 · 3 comments
Open

Warnings in console while running web expo #5967

djaffer opened this issue May 2, 2024 · 3 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Web This issue is specific to web

Comments

@djaffer
Copy link

djaffer commented May 2, 2024

Description

There are 31 warnings showing for react-native-reanimated/lib/module/index.web.js file not exported correctly. This issue has been consistently overlooked. The exporting is not done properly with react-native-reanimated/lib/module/index.web.js.

 WARNING in ./node_modules/@react-navigation/drawer/lib/module/views/legacy/Overlay.js:26
export 'default'.'interpolateNode' (imported as 'Animated') was not found in 'react-native-reanimated' (possible exports: FlatList, Image, ScrollView, Text, View, addWhitelistedNativeProps, addWhitelistedUIProps, createAnimatedComponent)
  24 | import Animated from 'react-native-reanimated';
  25 | var interpolateDeprecated = Animated.interpolate,
> 26 |   interpolateNode = Animated.interpolateNode,
  27 |   cond = Animated.cond,
  28 |   greaterThan = Animated.greaterThan;
  29 | var interpolate = interpolateNode != null ? interpolateNode : interpolateDeprecated;

WARNING in ./node_modules/@react-navigation/drawer/lib/module/views/legacy/Overlay.js:27
export 'default'.'cond' (imported as 'Animated') was not found in 'react-native-reanimated' (possible exports: FlatList, Image, ScrollView, Text, View, addWhitelistedNativeProps, addWhitelistedUIProps, createAnimatedComponent)
  25 | var interpolateDeprecated = Animated.interpolate,
  26 |   interpolateNode = Animated.interpolateNode,
> 27 |   cond = Animated.cond,
  28 |   greaterThan = Animated.greaterThan;
  29 | var interpolate = interpolateNode != null ? interpolateNode : interpolateDeprecated;
  30 | var PROGRESS_EPSILON = 0.05;

WARNING in ./node_modules/@react-navigation/drawer/lib/module/views/legacy/Overlay.js:28
export 'default'.'greaterThan' (imported as 'Animated') was not found in 'react-native-reanimated' (possible exports: FlatList, Image, ScrollView, Text, View, addWhitelistedNativeProps, addWhitelistedUIProps, createAnimatedComponent)
  26 |   interpolateNode = Animated.interpolateNode,
  27 |   cond = Animated.cond,
> 28 |   greaterThan = Animated.greaterThan;
  29 | var interpolate = interpolateNode != null ? interpolateNode : interpolateDeprecated;
  30 | var PROGRESS_EPSILON = 0.05;
  31 | var Overlay = React.forwardRef(function Overlay(_ref, ref) {

web compiled with 33 warnings

Here is patch that fixes it:

diff --git a/node_modules/react-native-reanimated/lib/module/index.web.js b/node_modules/react-native-reanimated/lib/module/index.web.js
index bba2514..2d6671c 100644
--- a/node_modules/react-native-reanimated/lib/module/index.web.js
+++ b/node_modules/react-native-reanimated/lib/module/index.web.js
@@ -1,5 +1,8 @@
 'use strict';
 
 export * from './reanimated2';
-export * as default from './Animated'; // If this line fails, you probably forgot some installation steps. Check out the installation guide here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started#installation 1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) 2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache
+// export * as default from './Animated'; // If this line fails, you probably forgot some installation steps. Check out the installation guide here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started#installation 1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) 2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache
+import * as _default from './Animated';
+export default _default;
 //# sourceMappingURL=index.web.js.map
+

Steps to reproduce

Install fresh 3.10.0 then run expo web.

Snack or a link to a repository

https://snack.expo.io/

Reanimated version

3.10.0

React Native version

0.72.8

Platforms

Web

JavaScript runtime

Hermes

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Web This issue is specific to web Missing repro This issue need minimum repro scenario labels May 2, 2024
Copy link

github-actions bot commented May 2, 2024

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@djaffer djaffer changed the title Warnings in console while running web Warnings in console while running web expo May 2, 2024
@tomekzaw
Copy link
Member

tomekzaw commented May 5, 2024

@djaffer Thanks for reporting this issue as well as submitting a patch.

I'm afraid we can't really replace export * as default from './Animated'; with separate import and export as it breaks tree-shaking.

Also, Reanimated 3 no longer exports interpolateNode, cond, greaterThan etc.

It looks like you might be using an outdated version of @react-navigation/drawer, can you please upgrade to the latest and see it if helps?

@djaffer
Copy link
Author

djaffer commented May 6, 2024

Does it require upgrading to expo 50?
I am using
"@react-navigation/drawer": "^6.6.15",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Web This issue is specific to web
Projects
None yet
Development

No branches or pull requests

2 participants