-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Issues with context & styled-components in node module #1144
Comments
Try to reproduce it with the npm modules. You can install npm modules locally with Those paths can be relative urls as well. |
When I move a component to a local npm module and install that using the This is the error stack I get when JS is enabled in the browser (so this is thrown after the JS runs in the client)
|
I've been digging in the code of styled-components a bit and I think the issue is related with context. It subscribes to a "channel" on the context named So basically this if statement fails, and then it looks for a theme passed in as prop, which is obviously not there, resulting in an empty theme. Did the bump from beta18 to beta19 caused any changes to the context that could cause this? |
@rovansteen 8b94534 this was added in beta.19. I'm not sure if it is related. But there were some fixes on it since then. So could you please try the latest beta? |
@timneutkens unfortunately it's still broken. I've tried something simple with the styled-components example in the repo and it breaks when you add a theme. I created a separate issue for that #1416 I hope that fixing that also fixes this problem. |
Closing this for now because I am not able to setup a minimal reproduction of the issues I ran into. Might try |
I'm running in to an issue where I am using a private node module that contains small components that use styled-components and expect a theme to be set by the package that includes it. This was working fine in
next@2.0.0-beta.17
but after upgrading to beta 26 it stopped working. The theme passed in to the component from the external package is just empty.I've tried to reproduce this outside my project but failed to do so because it works fine when you define the components that use the theme inside the project itself. I've narrowed it down to a specific version, it works in beta 18 but breaks in beta 19. I've tried looking at the changes made in that release but couldn't find anything that would explain this.
Do you might have an idea what's changed that would have this effect?
The text was updated successfully, but these errors were encountered: