-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Fixed Bug] Array spreading and string interpolation not working correctly #36
Comments
Thanks for your feedback. But I can't reproduce your error. Online Demo for issue#36 - stackblitz.comDo 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.
|
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
Resolved in 7.14.6 for us, which didn't work. |
I've tried the following
Could you try add these options to your 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: 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
The text was updated successfully, but these errors were encountered: