-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Unexpected token : #450
Comments
Please make an example as described here so I could reproduce the error.. |
@sapegin Sure I wrote a simple component and failing test. export default class Test extends React.Component {
render() {
return (
<div></div>
);
} Test:
I'm getting the same error as I mentioned above. I'm testing it on Google Chrome 59.0. I'm using React 15.4.2. Here's what my webpack.config file looks like: module.exports = {
target: 'web',
entry: {
client: path.join(__dirname, 'client.js')
},
output: {
path: path.join(__dirname, './build/public'),
},
externals: {
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
},
resolveLoader: {
modules: [
`${__dirname}/src`,
`${__dirname}/node_modules`
],
extensions: ['.json', '.js', '.jsx', '.css', '.less']
},
resolve: {
modules: [
`${__dirname}/src`,
`${__dirname}/node_modules`
],
extensions: ['.json', '.js', '.jsx', '.css', '.less']
},
module: {
rules: [
{
test: /\.js(x)?$/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.json$/,
use : 'json-loader'
}
]
}
} Hopefully this is enough context. |
I can’t reproduce it in an example style guide.
|
I was able to eliminate the error by removing my resolver/resolveLoader properties from my Webpack build. This seems to be causing the error. Unfortunately I need custom resolvers. Is there a way to get around this? |
Looks like you have the same issue as #359. Maybe try to use |
@sapegin That was the same issue I had. It's working perfectly now. Thanks for the help! |
I'm getting an error in my readme file where JSON is presumably not recognized/loaded. The error is:
My style guide config looks like:
I'm using Webpack 2.2.1.
The text was updated successfully, but these errors were encountered: