Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceeded when used in Quasar Framework #1980

Closed
kidox opened this issue Apr 2, 2019 · 3 comments
Closed

Maximum call stack size exceeded when used in Quasar Framework #1980

kidox opened this issue Apr 2, 2019 · 3 comments
Labels
🐛 bug Unintended behavior ☔ has workaround this issue has a workaround

Comments

@kidox
Copy link

kidox commented Apr 2, 2019

Versions

  • vee-validate: 2.2.0
  • vue: 3.4.1
  • Quasar Framework
  • Quasar-Cli: 0.17.24

Bug description
When adding vee-validate to a Quasar Framework plugin it causes a
Error in nextTick: "RangeError: Maximum call stack size exceeded"
every time you make a Router.push to the root path.

Error

vue.runtime.esm.js?2b0e:587 [Vue warn]: Error in nextTick: "RangeError: Maximum call stack size exceeded"
logError @ vue.runtime.esm.js?2b0e:1733
globalHandleError @ vue.runtime.esm.js?2b0e:1728
handleError @ vue.runtime.esm.js?2b0e:1717
(anonymous) @ vue.runtime.esm.js?2b0e:1835
flushCallbacks @ vue.runtime.esm.js?2b0e:1754
vue.runtime.esm.js?2b0e:1737 RangeError: Maximum call stack size exceeded
    at ErrorBag.reactiveGetter [as vmId] (vue.runtime.esm.js?2b0e:981)
    at mergeData (vue.runtime.esm.js?2b0e:1130)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)
    at mergeData (vue.runtime.esm.js?2b0e:1135)

Stepts to reproduce

  1. Install a fresh copy of Quasar Framework in PWA mode
    • yarn global add quasar-cli
    • quasar init testquasarveevalidate
  2. Install and import 'vee-validate' as a plugin
    • npm install vee-validate
    • quasar new plugin vee-validate and edit created file 'src/plugins/vee-validate.js' and add the following code:
import VeeValidate from 'vee-validate'

export default ({ Vue }) => {
  Vue.use(VeeValidate)
}
  1. Link the plugin inside quasar.conf.js file:
module.exports = function (ctx) {
  return {
    // app plugins (/src/plugins)
    plugins: [
      ...
      'vee-validate'
    ],
    ...
  1. Set @click.prevent="$route.push('/')" from any button or point to any incorrect route and try to get back to the previous route using default error page back button

image

Additional context
Validatins in forms still work as expected but plugin breaks vue routes.

@logaretm logaretm added the 🐛 bug Unintended behavior label Apr 3, 2019
@logaretm
Copy link
Owner

logaretm commented Apr 3, 2019

This is caused by a circular reference in vee-validate code, I'm currently in the process of re-writing everything, so this issue might be fixed then.

@Mighty683
Copy link

I have occured the same problem with vee-validate when I was using large number of custom inputs on the same component.

@logaretm
Copy link
Owner

I have tested this again, and there is a workaround for this. You should disable the automatic error injection with the inject option:

import VeeValidate from 'vee-validate'

export default ({ Vue }) => {
  Vue.use(VeeValidate, { inject: false })
}

And anywhere where you would need to use vee-validate you inject a new validator like this:

<script>
export default {
  $_veeValidate: {
    validator: 'new' // inject a new validator to be used by the directives.
  },
  name: 'Form'
}
</script>

This is documented here and is a similar use case to Nuxt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior ☔ has workaround this issue has a workaround
Projects
None yet
Development

No branches or pull requests

3 participants