-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Symlink and Redux #6027
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
Comments
Hi @fabienbranchel, thanks for the report. Can you publish a quick test repository to help us isolate the issue? Are your exported components already connected? Or are you connecting them in your project? |
I can try to publish a quick test, I work on it. ;) |
I'll take a look when you can provide a test repository and will provide feedback then, @fabienbranchel :) Thanks for your patience. |
The project test repository, named shelby-react : https://github.com/fabienbranchel/shelby-react To do :
Thank you. |
I have exactly the same problem. In my case I think I found the problem but I'm still trying to figure out how to fix it. Let's say I have two packages Did I get it right? |
You should declare "react-redux" as a peer dependency in your module-base package. See : |
Hi @afrz, I already tried that, but with it as peerDependencies when I use |
Ok sorry, I "skipped" the symlink part.. But, I remember that all code in node_modules (including the linked package) is expected to be fully transpiled. So you cannot directly have JSX components or ES6+ features there. C-R-A team can correct me if I am wrong, but I believe C-R-A does not support this scenario : having untranspiled linked package... |
Yes, my understanding is that this is a dependency issue. Can you try using dependency injection here? Or, as mentioned, list the dependency as a PS: Sorry for the slow response, Christmas workload got the best of me this week. |
@mrmckeb : Not sure what you mean by "try using dependency injection" ? As mention above, I tried to list react-redux as a |
If you make it a peerDependency and therefore DO NOT have the package in the linked module, then you will not be able to find it in the package trying to USE the linked module. From googling, there is an option |
@morgs32 : Oh, didn't know this one. 👍Do you mean try to list react-redux as a |
Well I was experiencing the issue in a react app. I ended up configuring webpack to follow the symlinks: |
@morgs32 : I try to add it in Still the same. :( |
Indeed, I see in the doc that |
@fabienbranchel Try changing the
to this:
This will force webpack to look into your app dependencies first. Or try setting |
@arutkowski00 : seems to work, thank you !!! |
@arutkowski00 Modifying |
@fabienbranchel @fortinmike My colleague created the PR #6207 |
@arutkowski00 : Tried the symlinks to false, it didn't works for me. Your first suggestion is the good one. Thanks to both of you for the PR. ;) |
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. |
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. |
Don't! |
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. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
Uh oh!
There was an error while loading. Please reload this page.
Is this a bug report?
Not sure.
Which terms did you search for in User Guide?
I have a pretty specific configuration, so User Guide isn't helpful here.
Environment
Environment Info: System: OS: Windows 10 CPU: x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz Binaries: npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 41.16299.785.0 Internet Explorer: 11.0.16299.371 npmPackages: @mdi/react: ^1.1.0 => 1.1.0 @types/react: ^16.6.0 => 16.7.13 @types/react-dom: ^16.0.9 => 16.0.9 react: ^16.6.0 => 16.6.0 react-dom: ^16.6.0 => 16.6.0 react-scripts: ^2.1.0 => 2.1.0 npmGlobalPackages: create-react-app: Not Found
My issue
My app use my own NPM package, grouping some components.
App component declare the Router. Each route is either use internal component or external component from my NPM package.
The connect function of react-redux works fine with internal components. However, I have an error when I try to use connect with external components :
Could not find "store" in the context of "Connect(ExternalComponent)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(ExternalComponent) in connect options.
Also, when I remove the connect function and use standard React code, it's fine.
Not sure where to post this issue. React issue, Redux issue, Create React App issue ?
Because it's working fine without the symlink, maybe there is an incompatiblity between symlink, webpack conf of Create React App and Redux connect function.
The text was updated successfully, but these errors were encountered: