yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.46k stars 2.73k forks source link

Yarn install with v1.2.1 but not v1.1.0 causes missing modules warnings in Flow #4783

Open erhathaway opened 7 years ago

erhathaway commented 7 years ago

Version: 1.2.1

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

After running yarn install with version 1.2.1, Flow fails to find certain modules. This doesn't occur when using yarn 1.1.0

The flow errors that this version causes are:

$ yarn run flow
yarn run v1.2.1
$ flow
node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js:19
 19: var ReactNative = require('ReactNative');
                       ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js:15
 15: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS.ios.js:16
 16: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/MapView/MapView.js:17
 17: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/Navigation/NavigatorIOS.ios.js:19
 19: var ReactNative = require('ReactNative');
                       ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js:15
 15: var NativeMethodsMixin = require('NativeMethodsMixin');
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/RefreshControl/RefreshControl.js:15
 15: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/ScrollResponder.js:17
 17: var ReactNative = require('ReactNative');
                       ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/Components/ScrollResponder.js:23
 23: var { getInstanceFromNode } = require('ReactNativeComponentTree');
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ReactNativeComponentTree. Required module not found
node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js:19
 19: const ReactNative = require('ReactNative');
                         ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js:14
 14: var NativeMethodsMixin = require('NativeMethodsMixin');
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/Slider/Slider.js:16
 16: var NativeMethodsMixin = require('NativeMethodsMixin');
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/Switch/Switch.js:15
 15: var NativeMethodsMixin = require('NativeMethodsMixin');
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/TextInput/TextInput.js:17
 17: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/TextInput/TextInput.js:20
 20: const ReactNative = require('ReactNative');
                         ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/Components/Touchable/TouchableBounce.js:16
 16: var NativeMethodsMixin = require('NativeMethodsMixin');
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Components/View/View.js:15
 15: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/CustomComponents/ListView/ListView.js:37
 37: var ReactNative = require('ReactNative');
                       ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/CustomComponents/Lists/FlatList.js:37
 37: const ReactNative = require('ReactNative');
                         ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/CustomComponents/Lists/VirtualizedList.js:37
 37: const ReactNative = require('ReactNative');
                         ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/Image/Image.ios.js:18
 18: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Interaction/ReactPerfStallHandler.js:15
 15: const ReactPerf = require('ReactPerf');
                       ^^^^^^^^^^^^^^^^^^^^ ReactPerf. Required module not found
node_modules/react-native/Libraries/Performance/RCTRenderingPerf.js:14
 14: var ReactDebugTool = require('ReactDebugTool');
                          ^^^^^^^^^^^^^^^^^^^^^^^^^ ReactDebugTool. Required module not found
node_modules/react-native/Libraries/Performance/RCTRenderingPerf.js:15
 15: var ReactPerf = require('ReactPerf');
                     ^^^^^^^^^^^^^^^^^^^^ ReactPerf. Required module not found
node_modules/react-native/Libraries/Performance/Systrace.js:73
 73:           require('ReactDebugTool').removeHook(ReactSystraceDevtool);
               ^^^^^^^^^^^^^^^^^^^^^^^^^ ReactDebugTool. Required module not found
node_modules/react-native/Libraries/ReactNative/AppContainer.js:18
 18: const ReactNative = require('ReactNative');
                         ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/ReactNative/AppRegistry.js:17
 17: const ReactNative = require('ReactNative');
                         ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/ReactNative/UIManager.js:18
 18: const findNodeHandle = require('findNodeHandle');
                            ^^^^^^^^^^^^^^^^^^^^^^^^^ findNodeHandle. Required module not found
node_modules/react-native/Libraries/ReactNative/renderApplication.js:17
 17: var ReactNative = require('ReactNative');
                       ^^^^^^^^^^^^^^^^^^^^^^ ReactNative. Required module not found
node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js:18
 18: const createReactNativeComponentClass = require('createReactNativeComponentClass');
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ createReactNativeComponentClass. Required module not found
node_modules/react-native/Libraries/StyleSheet/StyleSheet.js:15
 15: var ReactNativePropRegistry = require('ReactNativePropRegistry');
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ReactNativePropRegistry. Required module not found
node_modules/react-native/Libraries/StyleSheet/flattenStyle.js:14
 14: var ReactNativePropRegistry = require('ReactNativePropRegistry');
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ReactNativePropRegistry. Required module not found
node_modules/react-native/Libraries/Text/Text.js:16
 16: const NativeMethodsMixin = require('NativeMethodsMixin');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NativeMethodsMixin. Required module not found
node_modules/react-native/Libraries/Text/Text.js:25
 25: const createReactNativeComponentClass = require('createReactNativeComponentClass');
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ createReactNativeComponentClass. Required module not found
Found 34 errors

If the current behavior is a bug, please provide the steps to reproduce.

Private repo, but it should be reproducible if you use a create react native app ejected into the expo environment. This error occurs with multiple versions of flow including 0.40.0.

What is the expected behavior?

These modules exist and should be found and installed correctly

Please mention your node.js, yarn and operating system version.

Node: 8.8.0 macOS Sierra: 10.12.6

edmorley commented 7 years ago

Hi!

Private repo, but it should be reproducible if you use a create react native app ejected into the expo environment.

As someone who's not yet familiar with flow, I don't suppose you could provide some more detailed STR? Also, does running yarn list for the node_modules generated with both versions show any obvious differences?