SimulatedGREG / electron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.46k stars 1.54k forks source link

无法编译解析async/await语法? #1044

Open li-car-fei opened 3 years ago

li-car-fei commented 3 years ago

报错:TypeError: Cannot assign to read only property 'exports' of object '#'

我在一个文件中使用ES7语法如下: async function testAsync(){ var a = 1; await a+2; return a }

module.exports = { test }

在组件中引用上放的函数,便报错: TypeError: Cannot assign to read only property 'exports' of object '#'

这是因为无法编译ES7语法吗?要怎么解决呢?

li-car-fei commented 3 years ago

TypeError: Cannot assign to read only property 'exports' of object '#'

when I write: async function testAsync(){ var a = 1; await a+2; return a }

module.exports = { test } in test.js

and I use testAsync in a component.vue, I get the error: TypeError: Cannot assign to read only property 'exports' of object '#'

Shaco223 commented 2 years ago

报错:TypeError: Cannot assign to read only property 'exports' of object '#'

我在一个文件中使用ES7语法如下: async function testAsync(){ var a = 1; await a+2; return a }

module.exports = { test }

在组件中引用上放的函数,便报错: TypeError: Cannot assign to read only property 'exports' of object '#'

这是因为无法编译ES7语法吗?要怎么解决呢?

解决了吗,我也遇到了