Nuxt Error: Syntax Unexpected token export after installation Nuxt Error: Syntax Unexpected token export after installation vue.js vue.js

Nuxt Error: Syntax Unexpected token export after installation


I just checked your issue and it happens when you use element UI with Nuxt. Update your Nuxt configuration like this(Andrew Answer):

plugins: [  {src: '~/plugins/element-ui', ssr: false},  {src: '~/plugins/vee-validate.js', ssr: true},],


This error can show up if you're importing an ES6 module which needs to be transpiled in order to load into the UI. In that case, this is fixed by adding the module into the transpile key of the build section of nuxt.config.js (at time of this post, the Nuxt transpile docs are a little confusing).

For instance, if you're trying to import a module called @stylelib then you'd want the following in your nuxt.config.js:

export default {  ...  build: {    ...    transpile: ['@stylelib']  }}


I had the same issue and it was found in my nuxt.config.js file where i had placed some extra code with a ',' at the end of that code. The code in question was at the top of the file.

The code:

env: {    strapiBaseUri: process.env.API_URL || "http://localhost:1337"},

My setup details are:

Nuxtjs (version as of March 20, 2020)Apollo and GraphqlStrapi (backend)