Vue-chartjs: LIB_VERSION is not defined

Created on 11 Feb 2018  ·  10Comments  ·  Source: apertureless/vue-chartjs

With 3.2 release I see that you added LIB_VERSION constant that you resolve with webpack.

However when using webpack 2 to build my project I also have to define this constant or revert code changes in es/index.js.
Without that, I get ReferenceError: LIB_VERSION is not defined

I think this package should work without modifications like this.

⚠️️ bug

Most helpful comment

Sorry for that. Did not thought about the case, that if the es sources will be loaded the webpack.define() plugin will not work.

It's fixed now in 3.2.1

chuber-my-bad-xT0BKFyZt9MMx9xkpW

All 10 comments

Having the same error. @Laruxo where and how do you define it to make it work?

I get the same error as following on the all browser with windows 10 (chrome, ie 11, firefox, opera... etc). (note that is working good on the osx.)

index.js?5253:4 Uncaught ReferenceError: LIB_VERSION is not defined
at eval (index.js?5253:4)
at Object../node_modules/vue-chartjs/es/index.js (app.js:2903)
at __webpack_require__ (app.js:679)
at fn (app.js:89)
at eval (selector.js?type=script&index=0!./src/components/Update/Dashboard/VersionChart.vue:1)
at Object../node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/Update/Dashboard/VersionChart.vue (app.js:1045)
at __webpack_require__ (app.js:679)
at fn (app.js:89)
at eval (VersionChart.vue?139a:1)
at Object../src/components/Update/Dashboard/VersionChart.vue (app.js:3412)

Looks like it is related to this PR https://github.com/apertureless/vue-chartjs/pull/305.

https://github.com/apertureless/vue-chartjs/pull/305/files#diff-e4403a877d80de653400d88d85e4801aR20
https://github.com/apertureless/vue-chartjs/pull/305/files#diff-8dc8796144fc0bf0dc97a14a920bbe66R80

Reverting to 3.1.0 solves the issue for now.

I tried version 3.1.0 but the error still occurs.

"dependencies": {
"axios": "^0.17.1",
"chart.js": "^2.7.1",
"es6-promise": "^4.2.3",
"vue": "^2.5.2",
"vue-chartjs": "^3.1.0",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},

Your version constraint pulls in everything that matches 3.1.0 or higher. You need to specifically require "vue-chartjs": "3.1.0".

Thanks a lot. It works perfectly.
Do you know if I should continue to use this version?
Or, can I use the latest version in the future?

The error is currently caused by the build process with Webpack so once that is fixed you should be able to pull in ^3.2.0.

For now just use 3.1.0 and wait for a fix.

Okay. I understood everything.
Thanks.

Same error happening here. Dwgrading to 3.1.0 worked.

Sorry for that. Did not thought about the case, that if the es sources will be loaded the webpack.define() plugin will not work.

It's fixed now in 3.2.1

chuber-my-bad-xT0BKFyZt9MMx9xkpW

Was this page helpful?
0 / 5 - 0 ratings