dabernathy89 / vue-query-builder

A UI component for building complex queries with nested conditionals.
https://dabernathy89.github.io/vue-query-builder/
MIT License
643 stars 157 forks source link

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

Open chandero opened 4 years ago

chandero commented 4 years ago

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

dabernathy89 commented 4 years ago

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.

justonep commented 4 years ago

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

chandero commented 4 years ago

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.

dabernathy89 commented 4 years ago

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

justonep commented 4 years ago

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