Open jonathanprl opened 2 years ago
Thanks for your feedback. But I can't reproduce your error.
Do I miss anything?
Could try to re-produce your error by forking the online demo above? So that I can locate your error and fix it ASAP.
assumptions
for babel.config.js
?We resolved this issue by manually adding @babel/core and babel-loader to the project. Updating other packages never upgraded babel to a high enough version to make array spreading work together with vue-template-babel-compiler.
I haven't pinpointed the exact version but babel core 7.17.9 works.
We resolved this issue by manually adding @babel/core and babel-loader to the project. Updating other packages never upgraded babel to a high enough version to make array spreading work together with vue-template-babel-compiler.
I haven't pinpointed the exact version but babel core 7.17.9 works.
@martijnhartlief Thanks for you feedback.
It sounds like this error has something to do with babel version?
I'm trying to reproduce it.
If anyone can provide a reproduction demo, it will help a lot for fix this issue ASAP.
For example: Online Demo for issue#36 - stackblitz.com
Sorry I don't have time to pinpoint the exact version but
"dependencies": {
"@babel/core": "^7.14.3"
}
Resolved in 7.14.6 for us, which didn't work. Maybe if you lock the exact version you can reproduce from which version it works.
I've tried the following @babel/core
version, they all works fine without error:
Could you try add these options to your vue.config.js
?
module.exports = {
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.tap(options => {
options.compilerOptions.babelOptions = {
filename: 'AfterVueTemplateBabelCompiler.js',
assumptions: {
iterableIsArray: true,
arrayLikeIsIterable: false,
},
}
options.compiler = require('vue-template-babel-compiler')
return options
})
}
}
As far as I know, the error above is because babel use helper function in the compile result: _toConsumableArray
, _defineProperty
So add these options will let babel know we don't need helper function.
Installing 1.2 also fixed the issue without the extra vue.config changes
Array Spreading
Current behavior
Vue Code
Compiled Code
Error
Expected behavior
No error and the array should be created as expected.
String interpolation
Current behavior
Vue Code
Compiled Code
Error
Expected behavior
No error and the class should have correct keys
Extras
Using the latest version v1.1.3