Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140273

Vuejs Error in render: "TypeError: Cannot read property 'props' of undefined" Vuejs

$
0
0

I would like to know why do I get warnings and errors for this simple code. I am using vue templates. This is my first Vue applications so please provide a little bit more detail so I can follow through.

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in render: "TypeError: Cannot read property 'props' of undefined"

found in

---> <App> at src/App.vue
       <Root>

vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property 'props' of undefined
at normalizeProps (vue.runtime.esm.js?2b0e:1419)
at mergeOptions (vue.runtime.esm.js?2b0e:1521)
at mergeOptions (vue.runtime.esm.js?2b0e:1535)
at Function.Vue.extend (vue.runtime.esm.js?2b0e:5153)
at createComponent (vue.runtime.esm.js?2b0e:3184)
at _createElement (vue.runtime.esm.js?2b0e:3416)
at createElement (vue.runtime.esm.js?2b0e:3353)
at vm._c (vue.runtime.esm.js?2b0e:3485)
at Proxy.render (eval at ./node_modules...

Here is the child vue

Animakit.vue

<template>

        <div id="Animakit">
         In Animakit

        </div>
    </template>


    <script>

        import firstOne from '../animakit.js'
        export default {
            name: 'Animakit',
            mixins: [firstOne],
            mounted: function () { this.firstOne() }
        }
    </script>

Here is the main App vue

App.vue

<template>
    <div id="app">
        <Animakit></Animakit>
        <div>hello in App.vue </div>
    </div>
</template>

<script>
    import Animakit from './components/Animakit.vue'

    export default {
        components: {
            'Animakit': Animakit
        }
    }
</script>

This is how App vue is used.

main.js

import Vue from 'vue';
import BootstrapVue from 'bootstrap-vue';
import axios from 'axios';
import App from './App.vue';


const http = axios.create({
    baseURL: process.env.BACKEND_URL ? process.env.BACKEND_URL : 'http://localhost/todos',
});

Vue.prototype.$http = http;

Vue.use(BootstrapVue);

Vue.config.productionTip = false;

new Vue({

    render: (h) => h(App),
}).$mount('#app');

contents of the JavaScript file animakit.js

function firstOne() {


}
export default firstOne;

Viewing all articles
Browse latest Browse all 140273

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>