Nuxt.js: SyntaxError Unexpected Identifier

Created on 19 Jan 2020  路  1Comment  路  Source: nuxt/nuxt.js

Version

v2.11.0

Reproduction link

https://github.com/begueradj/poc-datetimer-picker

Steps to reproduce

I want to use this plugin in my Nuxt.js/VuetifyJs application. For this purpose, I created a plugins/datetime-picker.js file:

import Vue from 'vue'
import DatetimePicker from 'vuetify-datetime-picker'

Vue.use(DatetimePicker)

And in nuxt.config.js, declare the plugin as recommended on the documentation:

export default {
  plugins: ['~/plugins/datetime-picker']
}

What is expected ?

I expect the application to launch without errrors

What is actually happening?

I run yarn run dev to launch the server, I do not see any error in the Terminal, but when I open the broswer on http://localhost:3000/ I see:

SyntaxError
Unexpected identifier

Link to reproduce

Github link for the bug
Why this is happening ? I simply followed the steps mentioned on the documentation.
How to fix this ?

bug-report

>All comments

Its not issue of nuxt. Your package that u are trying to use not transpiled. Its cant be consumed as it is.
You need to add it to transpile
https://nuxtjs.org/api/configuration-build/#transpile
https://codesandbox.io/s/fervent-nobel-dpiil

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredreich picture jaredreich  路  3Comments

danieloprado picture danieloprado  路  3Comments

lazycrazy picture lazycrazy  路  3Comments

surmon-china picture surmon-china  路  3Comments

msudgh picture msudgh  路  3Comments