question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Symlink and Redux

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
arutkowski00commented, Jan 15, 2019

@fabienbranchel Try changing the resolve.modules inside webpack.config.js (source) from this:

modules: ['node_modules'].concat(/* ... */),

to this:

modules: [path.resolve('node_modules'), 'node_modules'].concat(/* ... */),

This will force webpack to look into your app dependencies first.

Or try setting symlinks to false (not true)

2reactions
arutkowski00commented, Mar 25, 2019

Don’t!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to connect component from external package with react ...
The connect function of react-redux works fine with internal ... I found the issue : I was working with a symlink via the...
Read more >
Symlinking React libraries for local development
When we use symlinks to link our dependencies, our assets (i.e. fonts, images, etc) fall outside of the project scope, and webpack fails...
Read more >
@nrwl/react-native:ensure-symlink | Nx
Next generation build system with first class monorepo support and powerful integrations.
Read more >
Publishing to NPM | Redux Made Easy with Rematch
The main purpose of using symbolic links, or symlinks, is that we can link a local dependency and use it in another project....
Read more >
NTFS Symlinks (reparse point) redux - Cygwin
NTFS Symlinks (reparse point) redux. Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com. Fri Nov 6 03:32:00 GMT 2009.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found