Uncaught SyntaxError: Unexpected token { in import statement

前端 未结 1 841

I\'m attempting to put my first full-stack application together and am getting an unexpected syntax error:

\"Uncaught SyntaxError: Unexpected token {\"

The error

相关标签:
1条回答
  • 2021-01-29 11:04

    The import and export statements are used frequently in web development, but they do not currently work automatically in a browser because they are newer features in the JavaScript language. You need to "build" the code into a format that the browser can execute. Example code on the web tends to assume that you are already doing this.

    There are different tools that allow you to do this, such as Rollup or Webpack.

    0 讨论(0)
提交回复
热议问题