0
votes

I'm getting foll. warning when I bundle my component files through webpack and try to use that into another component.

[Vue warn]: Failed to mount component: template or render function not defined.

I followed to many solutions on stackoverflow and github forums but they didn't work.

I'm using normal .vue file to define component.

Here is my webpack config,

entry : './example/index.js',
    output: {
        path    : path.resolve(__dirname, 'dist'),
        filename: 'app.js'
    },
    module: {
        rules: [
            {
                test  : /\.js$/, exclude: /node_modules/,
                loader: "babel-loader"
            },
            {
                test: /\.vue$/,
                loader: 'vue-loader',
            },
            {
                test: /\.css$/,
                use : [
                    {
                        loader: 'style-loader'
                    },
                    {
                        loader : 'css-loader',
                        options: {
                            url: false
                        }
                    }
                ]

            }
        ]
    },
    resolve: {
        extensions: ['.js', '.vue'],
        alias: {
          'vue$': 'vue/dist/vue.js'
        }
      },
    plugins: [
        new webpack.ProvidePlugin({
            $              : 'jquery',
            jQuery         : 'jquery',
            'window.jQuery': 'jquery'
        }),
        new VueLoaderPlugin(),
    ]

Thanks.

1
Can you show us the rest of the code please ? (Entry file, the component and VueJS Root)Ekushisu
@Ekushisu here you can find all the files of that project.John Kendal

1 Answers

-1
votes

{ path: '/about', component: ()=>import('vr/views/About.vue') }, ✅ { path: '/about', component: import('vr/views/About.vue') },❌ // But it works