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

"Syntax error: Unexpected token <" with webpack-dev-server and HotModuleReplacingPlugin #43

Closed
voronianski opened this issue Mar 23, 2015 · 6 comments

Comments

@voronianski
Copy link

Cannot make webpack-dev-server successfully reload on the fly my .jsx:

[HMR] Waiting for update signal from WDS...
Actions.js:120 [WDS] Hot Module Replacement enabled.
Actions.js:120 [WDS] App updated. Recompiling...
Actions.js:120 [WDS] App hot update...
Actions.js:120 [HMR] Checking for updates on the server...
Actions.js:120 [HMR] Update failed: SyntaxError: Unexpected token <
    at Object.parse (native)
    at XMLHttpRequest.request.onreadystatechange (http://localhost:9090/build/bundle.js:44:35)

config is as follows:

'use strict';

var webpack = require('webpack');

module.exports = {
    entry: './src/app.js',
    output: {
        path: __dirname + '/public/build/',
        filename: 'bundle.js',
        publicPath: '/build/'
    },
    resolve: {
        extensions: ['', '.js', '.jsx']
    },
    module: {
        loaders: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules/,
                loaders: ['react-hot', 'babel?experimental']
            }
        ]
    },
    plugins: [
        new webpack.NoErrorsPlugin()
    ]
};

using with CLI:

webpack-dev-server --hot --inline --progress --colors --port 9090
@voronianski voronianski changed the title Syntax error: Unexpected token < with webpack-dev-server and HotModuleReplacingPlugin "Syntax error: Unexpected token <" with webpack-dev-server and HotModuleReplacingPlugin Mar 23, 2015
@sebmck
Copy link
Contributor

sebmck commented Mar 23, 2015

What's on line 44 in build/bundle.js.

@voronianski
Copy link
Author

@sebmck mm, how I can get it? compiled bundle.js has only 28 lines.. I assume it's just an opening jsx tag..

@sebmck
Copy link
Contributor

sebmck commented Mar 23, 2015

Wouldn't be a babel-loader issue and instead a webpack config one then.

@voronianski
Copy link
Author

that's weird..

@madshargreave
Copy link

I have the same error

@Calabonga
Copy link

I have the same error too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants