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
yarn 2: styled-components tried to access babel-plugin-macros, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound #3082
Comments
This seems to work as a temporary workaround, in
|
Here is a repo reproducing the issue with CRA: https://github.com/oscar-b/styled-pnp |
Note: make sure to run
|
I owe you big time, @rek I was on the verge of pulling my hair trying to figure out why packageExtensions was not working. Not even a single resource in the numerous ones I checked mentioned the point that you did. Thanks a lot! |
I’m not relying on packageExtensions:
styled-components@*:
dependencies:
react-is: "*" I guess that if we add |
This comment has been minimized.
This comment has been minimized.
(node:58583) [MODULE_NOT_FOUND] Error: vite tried to access supports-color, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. (Use `node --trace-warnings ...` to show where the warning was created) (node:58583) [MODULE_NOT_FOUND] Error: debug tried to access supports-color (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. references - styled-components/styled-components#3082 (comment) - https://yarnpkg.com/configuration/yarnrc#packageExtensions
(node:58583) [MODULE_NOT_FOUND] Error: vite tried to access supports-color, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. (Use `node --trace-warnings ...` to show where the warning was created) (node:58583) [MODULE_NOT_FOUND] Error: debug tried to access supports-color (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. references - styled-components/styled-components#3082 (comment) - https://yarnpkg.com/configuration/yarnrc#packageExtensions
There is a vote in progress to potentially remove the babel macro due to lack of usage/interest, please vote if you care thanks. #4064 (comment) |
Environment
System:
Binaries:
Reproduction
Set up Create React App and activate yarn 2:
Steps to reproduce
Import
styled-components/macro
. On run, yarn pnp mode gives an error:The text was updated successfully, but these errors were encountered: