Vue-grid-layout: 2.3.11 build error

Created on 14 Oct 2020  ·  18Comments  ·  Source: jbaysolutions/vue-grid-layout

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
| });
| },

Most helpful comment

What is the solution?

because the version 2.3.11, used es6 and when i build i exculde node_modules module
so,you can use babel-loder to solute this question,just like this
{
test: /.js$/,
use: {
loader: 'babel-loader?cacheDirectory'
},
include: [
resolve('src'),
resolve('test'),
resolve('node_modules/vue-grid-layout')
]
},

All 18 comments

What is the solution?

What is the solution?

because the version 2.3.11, used es6 and when i build i exculde node_modules module
so,you can use babel-loder to solute this question,just like this
{
test: /.js$/,
use: {
loader: 'babel-loader?cacheDirectory'
},
include: [
resolve('src'),
resolve('test'),
resolve('node_modules/vue-grid-layout')
]
},

I had the same problem,but the solution didn't work

he same problem,but the solution didn't work

show me your babel-loader code
and this problem has other solution,that is just set package.json vue-grid-layout:@2.3.7

he same problem,but the solution didn't work

show me your babel-loader code
and this problem has other solution,that is just set package.json vue-grid-layout:@2.3.7

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

We have a webpack sample using vue-grid-layout 2.3.11 here: https://github.com/jbaysolutions/vue-grid-layout-sample-v2

We have a webpack sample using vue-grid-layout 2.3.11 here: https://github.com/jbaysolutions/vue-grid-layout-sample-v2

If you try require babel-polyfill , you will find the problem. Modification_Modification in vue-grid-layout.common.js is not compiled.

You may use the wrong version. After 2.1.13 ,they use vue-cli to build it,not web-package.So you can npm i [email protected] -S instead,if you use vue early version

Having the same issue with 2.3.11;; 2.3.7 is working fine.. i'm using vuetify with vue-cli

I did what @redrockhorse recommended and it worked, anyone knows the changes between 2.1 and 2.3?

All i did was to create a project with vue-cli legacy vue init webpack demo-vue-grid-layout and npm install vue-grid-layout --save to install the package, so it should work right out the box or am i missing something?

For what it's worth -- I was also working fine with 2.3.7.just like @tauanbinato but 2.3.11 was causing this error for me, and the require() fix did not work for me (it was already in place to make 2.3.7 work for me).

I was trying to upgrade because I was not getting the responsive breakpoint change event function firing. I ended updating to 2.3.8, and that allowed the function to work for me.

After i use babel-loder to solute this question, I has a new error called "export 'default' (imported as 'VueGridLayout') was not found in 'vue-grid-layout'

Version 2.3.12-legacy shouldn't have these issues

我2.3.12的,要报错,卸载了改为2.3.7的就可以了

The same problem and i change the version to 2.3.7, it works

我2.3.12的,要报错,卸载了改为2.3.7的就可以了

感谢,解决了

我2.3.12的,要报错,卸载了改为2.3.7的就可以了

感谢,解决了

The same problem and i change the version to 2.3.7, it works

You're welcome

2.3.7 leads other problems and i find that my company uses 2.3.4, all work

Was this page helpful?
0 / 5 - 0 ratings

Related issues

llwinner picture llwinner  ·  3Comments

jovanmabilin picture jovanmabilin  ·  6Comments

msiggi picture msiggi  ·  5Comments

protonbobby picture protonbobby  ·  3Comments

vitorhps picture vitorhps  ·  3Comments