[Vue warn]: You are using the runtime-only build of Vue...

qdotm
0
qdotm
commented 2 years ago

Hello, I am trying to use Vue-clip plugin in my Nuxt project. (http://vueclip.adonisjs.com)

This is my nuxt.config.js configuration file:

...
build: {
vendor: ['axios', 'vue-clip']
},
plugins: [
{ src: '~plugins/vue-clip.js', ssr: false }
],
...

And this is my ~plugins/vue-clip.js file:

import Vue from 'vue'
import VueClip from 'vue-clip'
Vue.use(VueClip)

This is the error I have on render:

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

Do you know where it could come from ?

The plugin itself has, in the webpack.config.js

resolve: { alias: { vue: 'vue/dist/vue.js' } }

Should I use the same alias in the nuxt.config.js file ?

Thank you very much for your help!

0
pi0
23.7k
pi0
commented 2 years ago

Hi. While normally not recommended using compile included build, it would be possible using this configuration: (source)

    build: {
        extend(config) {
            config.resolve.alias['vue'] = 'vue/dist/vue.common'
        }
    }
2
qdotm
0
qdotm
commented 2 years ago

@pi0 thank you so much for your answer, it works!
What would you recommend instead of using the compiler included build ?

0
pi0
23.7k
pi0
commented 2 years ago

Your welcome. That's actually packaging problem with the library which should pre-compile templates when releasing dists. That would be nice if you open an Issue/PR there mentioning this issue, I can help for fixing that if needed.

0
qdotm
0
qdotm
commented 2 years ago
0
mhpm
0
mhpm
commented 9 months ago

HELP ! , where is the file to add this
build: {
extend(config) {
config.resolve.alias['vue'] = 'vue/dist/vue.common'
}
}

mentioned by evan ?? my project is in vue cli 3

0
unr
20
unr
commented 9 months ago

You can read about extending your webpack config here, https://nuxtjs.org/api/configuration-build @mhpm

0
mikeconstable
0
mikeconstable
commented 6 months ago

@pi0 - thanks. I'm not using nuxtjs but your suggestion fixed a vue-d2b chart library within a Quasar-CLI project, adding a modified line to quasar.conf.js under the build section. In case it helps someone else:

build: {
scopeHoisting: true,

extendWebpack (cfg) {
cfg.resolve.alias['vue'] = 'vue/dist/vue.common'
cfg.module.rules.push({

})
}
},

Worked for me.

0
Informations
QuestionUnresolved
#c1004 - Created 2 years ago