Vue-grid-layout: Module parse failed: Unexpected token (10332:31) at build

Created on 22 Oct 2020  路  2Comments  路  Source: jbaysolutions/vue-grid-layout

error message

error in ./node_modules/vue-grid-layout/dist/vue-grid-layout.common.js

Module parse failed: Unexpected token (10332:31)
You may need an appropriate loader to handle this file type.
| subModification.prepareStates(modifiers);
| state.subModification = subModification;
| subModification.startAll({ ...arg

@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/report/reportPreview.vue 75:0-44
@ ./src/views/report/reportPreview.vue
@ ./src/router/modules/quote.js
@ ./src/router/index.js
@ ./src/router/permission.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server babel-polyfill ./src/main.js

my version

node: v12.19.0 & v14
npm: 6.14.8
vue: ^2.5.2
vue-grid-layout: ^2.3.7
babel-loader: ^7.1.1

solution

I know it's temporary
It comes from the Internet

module: {
  rules: [
    {
      test: /\.js$/,
      loader: 'babel-loader',
      include: [
        resolve('src'),
        resolve('test'),
        resolve('node_modules/webpack-dev-server/client'),
        resolve('node_modules/vue-grid-layout') // add
      ],
    },
  ]
}

I hope to get the best solution ! thinks
but, my colleague build it successfully. His "Node" version is 11

Most helpful comment

after vue-grid-layout: ^2.3.7 changed to vue-grid-layout: 2.3.7 build successful

All 2 comments

after vue-grid-layout: ^2.3.7 changed to vue-grid-layout: 2.3.7 build successful

Version 2.3.12-legacy shouldn't have these issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gmsa picture gmsa  路  8Comments

MLongz picture MLongz  路  7Comments

VitaliyInshakov picture VitaliyInshakov  路  5Comments

msiggi picture msiggi  路  5Comments

victory-v picture victory-v  路  7Comments