Static GitHub Issues

[2819] “is not defined” in Nuxt.js

prev: [question] Plugins vs Modules vs Vendor
next: [error] Command failed with exit code 3221225725.

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.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2448">#c2448</a>)</em></sub></div>