static propTypes Unexpected token
See original GitHub issueHi,
I am getting this error
Module parse failed: /Users/aris/project/front/views/components/.....jsx Unexpected token (19:21)
You may need an appropriate loader to handle this file type.
| class xxx extends React.Component {
|
| static propTypes = {
| propOne: React.PropTypes.func,
| propTwo: React.PropTypes.bool,
@ ./~/react-styleguidist/loaders/styleguide.loader.js!./~/react-styleguidist/src/index.js 77:10-76
@ ./~/react-styleguidist/src/index.js
@ multi main
I have a working-in-production react-webpack stack and i am loading all my loaders from my webpack configuration:
styleguide.config.js
title: 'Styleguide',
components: './views/components/**/*.jsx',
serverPort: 3005,
updateWebpackConfig(webpackConfig) {
webpackConfig.module.loaders.concat(configuration.module.loaders);
return webpackConfig;
}
I have a .babelrc file which includes stage-0 of ES7 and also I have a separate config file for babel loader in my webpack config.
PS: I am using Webpack 2.1.0-beta.25
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ReactJS: Unexpected token error from static proptypes
Step : 1 - I am assuming you are installing prop-types npm install --save prop-types as a seperate library and then importing it...
Read more >static propTypes. Module parse failed: Unexpected token #1055
Hello I've been trying to setup react-styleguidist for my react-native project for several hours now and I'm stuck.
Read more >Unexpected token error from static proptypes-Reactjs
Coding example for the question ReactJS: Unexpected token error from static proptypes-Reactjs.
Read more >eslint static proptypes unexpected token
eslint static proptypes unexpected token = · proptypes react not working · parsing error identifier proptypes has already been declared · module parse...
Read more >expo you may need an appropriate loader to handle this file ...
App.js 8:4 Module parse failed: Unexpected token (8:4) You may need an appropriate loader to ... Component { > static propTypes = {...
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 Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had this issue when I misconfigured my include/exclude paths and the imported file with spread operator was not “covered” by my loaders.
@stinoga Please, don’t include any Styleguidist pathes into your own loaders.
And I can’t reproduce it. Please make an example project.