'import' and 'export' may only appear at the top level

后端 未结 15 1582
耶瑟儿~
耶瑟儿~ 2020-12-08 18:00

I\'m using webpack with vuejs. Webpack does its thing, but when I look at the outputted app.js file, it gives me this error.

\'import\' and \'export\

15条回答
  •  悲&欢浪女
    2020-12-08 19:05

    I got this error when I was missing a closing bracket.

    Simplified recreation:

    const foo = () => {
      return (
        'bar'
      );
    }; <== this bracket was missing
    
    export default foo;
    

提交回复
热议问题