React/Nextjs
Module not found: styled-components tried to access react-is (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
sbjang123456
2022. 5. 13. 09:52
반응형
Yarn Berry + Nextjs + Styled-Component 로 개발을 하던 중 제목과 같은 에러가 발생하였다.
에러로그를 자세히 보면
Module not found: styled-components tried to access react-is (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: react-is Required by: styled-components@virtual:0487b1b8263ee74b6a800d7d32396247265bb66793913170b66fbaba014393ed5e7147a33f4bbb04ae9c659e18794d2a28c1045211d073c2ec3f37a52f31b1e7#npm:5.3.5
...
...
위와 같은 에러를 만난다.
로그를 자세히 보면 해결하는 것은 어렵지 않다.
Required package: react-is
그래서 해당 모듈을 추가해주었다.
yarn add react-is
참고
https://github.com/yarnpkg/berry/issues/966
[Bug] - Styled components - Module not found: A package is trying to access a peer dependency that should be provided by its dir
Bug description It is an CRA with only styled-components as dependencies see below for repo. Failed to compile. ./.yarn/$$virtual/styled-components-virtual-3b06c0951a/0/cache/styled-components-npm-...
github.com
반응형