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

Webpack #6

Open
m0rdreck opened this issue Feb 23, 2017 · 5 comments
Open

Webpack #6

m0rdreck opened this issue Feb 23, 2017 · 5 comments

Comments

@m0rdreck
Copy link

Hello i try to use this with webpack but i have one error on GMap file

Module build failed: SyntaxError: C:/js/components/maps/GMap.js: Unexpected token (34:22)

32 | >
33 | {

34 | clusters.map(({ ...markerProps, id, numPoints }) => (
| ^
35 | numPoints === 1
36 | ? <SimpleMarker key={id} {...markerProps} />
37 | : <ClusterMarker key={id} {...markerProps} />

Do you have an idea for this ? i have same error on ...cluster

@istarkov
Copy link
Owner

I think it's because of object rest spread in babel has changed in order to work by specification.
so { ...markerProps, id, numPoints } this is incorrect now, spread argument must be last.
So you need to change the order of arguments.

@m0rdreck
Copy link
Author

Change order no change error.

i think the error is in the syntax. he cannot accept to build ...var version of webpack ?

My loader can make this problems ?

    {
        test: /\.jsx?$/,
        include: path.join(__dirname, 'js'),
        exclude: node_modules_dir,
        loaders: ['react-hot-loader/webpack', 'babel?presets[]=es2015&presets[]=react'],
        presets: ['es2015', 'stage-0', 'react', 'react-hmre']
    },

@istarkov
Copy link
Owner

Im not sure that loader in your example uses the presets section below, so without stage-x preset object spread will not work for you.

@m0rdreck
Copy link
Author

you have right, i test to use babel rest spread transform. thank for your time

@m0rdreck
Copy link
Author

all is good 👍 i just add babel rest spread transform thank

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

2 participants