Open li-car-fei opened 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 '#'
报错: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语法吗?要怎么解决呢?
解决了吗,我也遇到了
报错: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语法吗?要怎么解决呢?