Home

Issue: 2819

“is not defined” in Nuxt.js

[issue link]

Hi
i’m working on a Single page Application using Nuxtjs
and i want to add a external js file to my project i added the below code to my nuxt.config.js file
script: [ { src: '****/wialon.js', body: true } ]
and in the default.vue file in mounted() this code
mounted () { wialon.core.Session.getInstance().initSession('***') // init session }
and i got this error when i npm run dev
'wialon' is not defined

but when i try to build this app (npm run build) and copy the files to my server or local host it is working!!

can you please help me with this.

Thanks.

This question is available on Nuxt.js community (#c2448)