Flow: styled-components/native. Required module not found
See original GitHub issueVersion
styled-components@2.1.1 flow-bin@0.47.0 flow-typed@2.1.5
Reproduction
Bootstrapped app with create-react-native-app. Installed storybook, styled-components and added flow. Installed definitions:
flow-typed install styled-components@2.1.1
Have really simple component:
/* @flow */
import React, { Children } from 'react';
import styled from 'styled-components/native';
type Props = {
onPress: Function,
children: Children
};
const Wrapper = styled.TouchableOpacity`background-color: steelblue;`;
const Button = ({ onPress, children }: Props) =>
<Wrapper onPress={onPress}>
{children}
</Wrapper>;
export { Button as default };
When I run flow, I’m getting this error:
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to solve the required module not found error in flow.js
Create a folder named flow-typed at the root of the project. 1.2 Create the definition file. Create a file which has the same...
Read more >Module not found: Can't resolve 'styled-component' [closed]
I created a new react app using create-react-app and then installed styled-component using npm . But when I use it in component, I...
Read more >How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d.ts) file containing `declare module 'XYZ';. If XYZ is a direct...
Read more >API Reference - styled-components
Returns a StyledComponent that does not accept children. Place it at the top of your React tree and the global styles will be...
Read more >styled-components-native-esm | Yarn - Package Manager
Changelog. All notable changes to this project will be documented in this file. If a contribution does not have a mention next to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As it seems that none of the issues here seem to be issues with our typings, but usage issues, I have to ask you to try to:
flowconfig
without extra sections) in the docs: https://www.styled-components.com/docs/api#flowlib
trick aboveAs the original poster resolved this and we don’t have a reproduction right now, I’d prefer new issues with more detailed descriptions instead of keeping a potentially unrelated issue going. Sorry 😄
@relekang Same problem here, the project was working fine but after remove node_modules and install it again with yarn. I got the same problem. (with create-react-app without native)
styled-components@2.1.1 flow-bin@0.50.0 flow-typed@2.1.2