Skip to content
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

export 'withTheme' was not found in 'styled-components' #483

Closed
rhysburnie opened this issue Feb 11, 2017 · 9 comments
Closed

export 'withTheme' was not found in 'styled-components' #483

rhysburnie opened this issue Feb 11, 2017 · 9 comments
Labels

Comments

@rhysburnie
Copy link

rhysburnie commented Feb 11, 2017

Hi,

Im getting export 'withTheme' was not found in 'styled-components' when I attempt to load withTheme.

i.e. this fails import styled, { withTheme } from 'styled-components';

I can only get it to work when I point directly to the following path:

import styled, { withTheme } from 'styled-components/lib/index';

It seems to be when its loading from the .es.js version in dist, which is strange because a search for widthTheme shows that it is in the export list.

for now I'll have to alias to 'styled-components/lib/index'

I was on an older version but then updated to 2.0.0-3 same issue - cheers

@mxstbr
Copy link
Member

mxstbr commented Feb 11, 2017

That's super weird. Are you using webpack?

@rhysburnie
Copy link
Author

Yes using webpack 2

@mxstbr
Copy link
Member

mxstbr commented Feb 15, 2017

Possibly an issue with our build setup then, something with the .es build?

@brunolemos
Copy link
Member

brunolemos commented Feb 16, 2017

Hi @rhysburnie, it's possibly not a bug on our end, but on your webpack config. Can you double check it? Does it happen with other packages besides styled-components?

  1. I tested with styled-components@v2.0.0-4 from npm and it worked fine
  2. I tested with styled-components.es.js dist file and it worked fine (actually it had a 'path' is not defined cc @mxstbr)

I'm using create-react-app instead of a custom webpack config.
Have you considered using it?

@mxstbr
Copy link
Member

mxstbr commented Feb 16, 2017

actually it had a 'path' is not defined

Oh no, that's ugly! Could you open an issue for that?

@JohnLouderback
Copy link

withTheme is also missing from the Typescript definitions as well

@mxstbr
Copy link
Member

mxstbr commented Feb 20, 2017

/cc @styled-components/typers

@patrick91
Copy link
Contributor

working on it :)

@mxstbr
Copy link
Member

mxstbr commented Mar 1, 2017

Done, coming in the next release!

@mxstbr mxstbr closed this as completed Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants