How to import a React component with Styled-Components in next using monorepo?

Asked

Viewed 5 times

-1

I’m using monorepo with Lerna and Yarn workspaces in a nextJS project, I can run the project but I can’t reuse components when I put Styled-Components in them. There’s always a mistake:

Module parse failed: Unexpected token (3:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import styled from 'styled-components';
| 
> export interface ButtonProps {}
| 
| const StyledButton = styled.div`

I’ve tried everything, but I can’t fix it, someone can help me set up Babel so I can import my components?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.