-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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. #2754
Comments
我用的vue-cli3, 没有vue.config.js 也没有 webpack配置文件,怎么弄呢? |
请自行创建 vue.config.js 文件 |
What if you wanted the runtime compiler only for jest tests? |
Use NODE_ENV to switch it |
Use NODE_ENV to switch it or rewite the module path in jest config |
Remap the module path in jest config |
i had the same question , and resolved it ! change your webpack.config.js or App.vue like this :
TIps: if you created your app by @vue/cli, please add code to your vue.config.js like this:
|
that |
if pass in |
You have to pass the router to your Vue instanciation : import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
console.log('[i] Starting client app')
Vue.config.productionTip = false
new Vue({
render: h => h(App),
store,
router,
components: { App }
}).$mount('#app') |
This solution work out for me. Thank you! |
Fixed by this way. |
the problem has been solved at vuejs-templates/webpack#215
|
I also encountered this problem when I converted the vue-cli 2.0 project into vue-cli 3.0. It resolved my issue |
Hi everybody, getting close to a solution: so problem is related to syntax for vue 3.0 + ? Is it different than vue 2.0 ? So could you please show a syntax that translate how to make use of multiple templates and components ?
if I try:
I cannot see the rating component. what is that I found former sytax more readable, espeically for more complex structures. P..s. could you help to pintpoint a tutorial that shows how to migrate to new syntax? But feeling it consumes quite much of time to solve this hiccups. Thank you for point at practical resources |
I also add useful resource: |
great! thank you |
Why do I need a Why doesn't |
For me, the solution was: |
This literally saved my day after over 3 hours of knocking my head! Thanks @db12138 . |
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
|
Or just add
For some reason the render function is required or it tries to compile an empty template and throws this warning, I think there should be a check if the template is empty as well to not throw this warning And you can get rid of your App.vue file as well as the vue template compiler to reduce build size |
On the vue.config.js file put: module.exports = { |
Hey, I'm using ant-design-vue and vue-router, this problem came up when I try to use router-view. adding vue.config.js file doesn't help me out to fix the issue. btw router doesn't work at all. any idea how to fix it? main.js
./router/main.js
App.vue
|
Thank you! :) |
Thanks, it can work. |
If anyone encounters this warning in running unit tests with vue-test-utils, it turns out I needed to supply a // SomeComponent.spec.js
import { mount } from '@vue/test-utils';
import Vue from 'vue/dist/vue.common.js';
import SomeComponent from './SomeComponent.vue';
const wrapper = mount(SomeComponent, {
localVue: Vue,
});
... I expected webpack to take care of using the correct vue because I set the correct alias, but vue-test-utils needed some help here. |
@LinusBorg This is regards to: Do you have an example of this? I've been trying to figure out how to get the compiler-included build to run in my jest tests but can't seem to get it to work. Thanks for the help, I know it's from awhile ago. |
@ebwittenberg in the
Doing so, |
What is the solution if my projects in Nuxt.js. I am doing a Nuxt.js project and facing the same problem. What is the solution for Nuxt.js? |
I created project by @vue/cli. I solved my problem use this:
|
Version
3.0.5
Reproduction link
http://excuse
Node and OS info
Node 8.11.1
Steps to reproduce
excuse
What is expected?
运行不了
What is actually happening?
报上面的错误
The text was updated successfully, but these errors were encountered: