vue-query-builder icon indicating copy to clipboard operation
vue-query-builder copied to clipboard

Vue Query Builder is not loading. TypeError: Cannot read property '0' of undefined

Open chandero opened this issue 5 years ago • 5 comments

Hi Friend,

I have the following inconvenience when using VueQueryBuilder, the following two errors occur:

  1. errorLog.js: 17 TypeError: Cannot read property '0' of undefined at VueComponent.data (VueQueryBuilder.common.js: 5159) at VueComponent.mergedDataFn (vue.esm.js: 1168) at getData (vue.esm.js: 3417) at initData (vue.esm.js: 3374) at initState (vue.esm.js: 3311) at VueComponent.Vue._init (vue.esm.js: 4628) at new VueComponent (vue.esm.js: 4798) at createComponentInstanceForVnode (vue.esm.js: 4310) at init (vue.esm.js: 4131) at createComponent (vue.esm.js: 5608) "data ()"

  2. TypeError: Cannot read property 'text' of undefined at VueQueryBuilder.common.js: 5213 at Array.forEach () at VueComponent.mergedRules (VueQueryBuilder.common.js: 5212) at Watcher.get (vue.esm.js: 3142) at Watcher.evaluate (vue.esm.js: 3249) at VueComponent.computedGetter [as mergedRules] (vue.esm.js: 3507) at VueComponent.vqbProps (VueQueryBuilder.common.js: 5227) at Watcher.get (vue.esm.js: 3142) at Watcher.evaluate (vue.esm.js: 3249) It was working fine, even before checking out the git repository.

What do you think? Thank you

chandero avatar Jan 28 '20 13:01 chandero

Hey @chandero - sorry about this. How are you loading the query builder? Are you able to put up a demo on CodeSandBox (or something similar like Codepen)?

I'll give it a shot myself too - I recently pushed up a major refactor, and things worked for me locally but perhaps I need to test it as a consumer as well.

dabernathy89 avatar Jan 28 '20 15:01 dabernathy89

@chandero Hello, I also encountered the same problem. How did you solve it?

justonep avatar Jul 30 '20 06:07 justonep

Hello, I just went back to review the instructions for use of the component and observed that there were some changes which apply, specifically in the rules.

chandero avatar Jul 30 '20 16:07 chandero

@justonep if you can reproduce the issue on https://codesandbox.io or something similar, I'm happy to investigate further!

dabernathy89 avatar Jul 30 '20 16:07 dabernathy89

I copied the following code completely: https://codesandbox.io/s/vue-query-builder-demo-tailwind-82tun?from-embed regAnalysis.vue == your project's APP.vue I'm sorry that this scene can't be reproduced in codesandbox.io, it only appears in my own project. image

justonep avatar Jul 31 '20 02:07 justonep