Problem with build with webpack2.1.0-beta
See original GitHub issueIt could be also webpack related issue, just wanted to make you aware about the problem
Version
1.0.10
Reproduction
in webpackbin it works - http://www.webpackbin.com/4yqYB5WlM but I’m not able to choose version of webpack
Steps to reproduce
git clone https://github.com/mayacode/react-redux-starter/tree/styled-components-problem
npm install
webpack
I have webpack@^2.1.0-beta.25
and webpack-dev-serve@^2.1.0-beta.10
installed globally.
Expected Behavior
const Title = styled.h1
should work
Actual Behavior
open index.html
in console you’ll see Uncaught TypeError: _styledComponents2.default.h1 is not a function(…)
but if you change const Title = styled.h1
to const Title = styled.default.h1
everything works
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Not working with webpack2.1.0.beta22 and further #33 - GitHub
i have troubles with resolve-url-loader (1.6.0) and webpack2.1.0.beta25 my webpack.config.js: const sourceMapQueryStr = (config.enabled.
Read more >Webpack Dev Server 2.1.0-beta.02 fails to load modules on ...
I'm setting up a new project with webpack2.1.0-beta.22 and web-pack-dev-server2.1.0-beta.2 . Now, I've set up a webpack build configs a few ...
Read more >Webpack v2.1.0-beta.23 issues with fix - sage - Roots Discourse
I've just been installing Trellis and ran into issues with Webpack v2.1.0-beta.23. It seems the one of the Webpack maintainer's is aware.
Read more >How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >karma-webpack | Yarn - Package Manager
The first preproccessor triggers the build of all the bundles/chunks and all following files just ... webpack: add support for webpack2.1.0-beta (bdd8c80) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
This is actually a problem with your setup. You’re telling both Babel and webpack to transpile ES2015 modules, which is why you end up with
.default.default
. /cc @TheLarkinn, maybe he has an idea how to avoid this?The fix is to disable babel’s modules transpiling in your
webpack.config.js
:(notice the
modules: false
)removed
.babelrc
file, and used this configWork perfectly without an
alias
tostyled-components
Thanks!!