JuniorTour / vue-template-babel-compiler

Enable Optional Chaining(?.), Nullish Coalescing(??) and many new ES syntax for Vue.js SFC based on Babel
https://www.npmjs.com/package/vue-template-babel-compiler
118 stars 9 forks source link

[Fixed Bug] Array deconstructing error in template #31

Open meatjam opened 2 years ago

meatjam commented 2 years ago

My devDependencies: image

Then use array deconstructing in template like this: image

Run dev server by vue-cli with command "vue-cli-service serve". The browser shows errors: ReferenceError: _maybeArrayLike is not defined. image

I've tried array deconstructing after removing this dependency "vue-template-babel-compiler",everything works fine.

JuniorTour commented 2 years ago

This is a bug, Thanks for your feedback.


Maybe we can fix this issue by add assumptions.iterableIsArray = true, to babel options.

Besides, #25 will be fixed too.

babel reproduction link for iterableIsArray


Do you have interest to fix this issue and become our Contributor?

You can:

  1. Try to reproduce this error. Setup DEMO Project can help.

  2. Follow CONTRIBUTING.md to make a Pull Request.

JuniorTour commented 2 years ago

We just publish v1.1.2, it will fix this issue.

Try it by:

npm install vue-template-babel-compiler@latest
// or 
yarn add vue-template-babel-compiler@latest

Thanks for your feedback again!