Yopadd / vue-chartist

Pluging chartist for vuejs
Do What The F*ck You Want To Public License
172 stars 21 forks source link

Uncaught TypeError: Cannot set property '$chartist' of undefined at Object.exports.install #57

Open zair07 opened 3 years ago

zair07 commented 3 years ago

This is my main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import Vuex from 'vuex'

import axios from 'axios'
import VueAxios from 'vue-axios'

const app = createApp(App)
app.use(Vuex)
app.use(router)
app.use(VueAxios, axios)
app.use(require('vue-chartist'))
app.mount('#app')

Also tried import Chartist again same error

I have included these js and css in index.html

<link href="<%= BASE_URL %>assets/libs/chartist/dist/chartist.min.css" rel="stylesheet">
<script src="<%= BASE_URL %>assets/libs/chartist/dist/chartist.min.js"></script>
<script src="<%= BASE_URL %>assets/libs/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.min.js"></script>

Also tried without these files still same error

Full error

DevTools failed to load SourceMap: Could not load content for http://localhost:8080/assets/libs/popper-js/dist/umd/popper.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for http://localhost:8080/dist/js/feather.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
log.js?1afd:24 [HMR] Waiting for update signal from WDS...
DevTools failed to load SourceMap: Could not load content for http://localhost:8080/assets/libs/chartist/dist/chartist.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for http://localhost:8080/assets/libs/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
index.js?84b5:10 Uncaught TypeError: Cannot set property '$chartist' of undefined
    at Object.exports.install (index.js?84b5:10)
    at Object.use (runtime-core.esm-bundler.js?5c40:2945)
    at eval (main.js?56d7:13)
    at Module../src/main.js (app.js:1234)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at Object.1 (app.js:1319)
    at __webpack_require__ (app.js:854)
    at checkDeferredModules (app.js:46)
    at app.js:994
exports.install @ index.js?84b5:10
use @ runtime-core.esm-bundler.js?5c40:2945
eval @ main.js?56d7:13
./src/main.js @ app.js:1234
__webpack_require__ @ app.js:854
fn @ app.js:151
1 @ app.js:1319
__webpack_require__ @ app.js:854
checkDeferredModules @ app.js:46
(anonymous) @ app.js:994
(anonymous) @ app.js:997
ercag commented 2 years ago

hi, i faced this problem and i just downgrade the version. "vue-chartist": "3.0.0" to "vue-chartist": "^2.3.1"

SPganiie commented 2 years ago

hi, i faced this problem and i just downgrade the version. "vue-chartist": "3.0.0" to "vue-chartist": "^2.3.1 thx for alot bro @ercag .helpfull for me