bbonnin / vue-morris

VueJS component wrapping Morris.js
MIT License
235 stars 36 forks source link

Uncaught reference error: jQuery is not defined #27

Closed Arjun3023 closed 5 years ago

Arjun3023 commented 5 years ago

I followed all the instructions given in the documentation, but still I am facing this issue. My webpack.config.js :

    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.esm.js',
            'jquery': 'jquery/src/jquery.js'
        },
        extensions: ['*', '.js', '.vue', '.json']
    },

I have even added vue.config.js

const webpack = require('webpack');
module.exports =
    {
        configureWebpack: {
            plugins: [
                new webpack.ProvidePlugin({ jQuery: 'jquery', })
                ,],
        },
    };

Nothing among these is helping me in solving my issue. Please help me into this issue. Thanks in advance

bruno-bonnin-cbp commented 5 years ago

Hi, Depending on the version of jQuery you use, the path jquery/src/jquery.js can be different. Have you checked it in you context ? I also maintain a small project as example for vue-morris, https://github.com/bbonnin/vue-morris-example, maybe it could help you.

Arjun3023 commented 5 years ago

The jQuery path was correct. I resolved this by again importing JQuery in the vue page itself. I was facing the problem because I was running vue pages in the mvc app. So, because of that the version of jquery being used was that of used in mvc pages. So by importing jquery here in the vue page again, helped me install the specific version required here.