-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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 "portal:" local components import compilation failure because of ModuleScopePlugin #9226
Comments
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Still unsolved |
Same issue in workspaces with Yarn 2 |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Up
Le dim. 13 sept. 2020 à 20:29, stale[bot] <notifications@github.com> a
écrit :
… This issue has been automatically marked as stale because it has not had
any recent activity. It will be closed in 5 days if no further activity
occurs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9226 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAVY6EDJPNDTYONF2TIJ3TSFUFO5ANCNFSM4OJGQVAQ>
.
|
I had the same problem, ended up having to eject and remove I understand that it CRA wants to prevent me from doing |
For what it's worth, if you are using yarn v2, you can use their patch protocol to patch |
Describe the bug
Description here: https://stackoverflow.com/questions/61530712/module-not-found-error-using-yarn-2-to-link-react-components
TLDR:
When adding
"MyExternalComponent": "portal:../MyExternalComponent"
dependencies to package.json, and importing the component withimport Mycomponent from MyExternalComponent
, the build fails because of the ModuleScopePlugin restriction "You attempted to import components which falls outside of the project src/ directory"Which terms did you search for in User Guide?
"yarn 2 ModuleScopePlugin"
"portal: ModuleScopePlugin"
Environment
yarn2
(paste the output of the command here.)
Steps to reproduce
(Write your steps here:)
4 build Bar
Expected behavior
Should work
Actual behavior
compilation error: "You attempted to import components which falls outside of the project src/ directory"
Reproducible demo
https://bitbucket.org/cjmyles/yarn2-link/commits/e02b93771dfded0215bdba456d31aea011367807
The text was updated successfully, but these errors were encountered: