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

getDependentsFor not working in ember octane throwing maximum call stack size exceeded error #679

Open
vishwasraj-thyagaraj opened this issue Jul 1, 2020 · 1 comment

Comments

@vishwasraj-thyagaraj
Copy link

Environment

  • Ember Version: 3.16.0
  • Ember CLI Version: 3.16.1
  • Ember CP Validations Version: 4.0.0-beta.10

Steps to Reproduce

EmberObject Syntax

ValidatorName.reopenClass({
  getDependentsFor(attribute, options) {
    return [];
  }
});

Class Syntax

@classic
class ValidatorName extends BaseValidator {
  static getDependentsFor(attribute) {
    return []
  };
}
export default ValidatorName;

Screen Shot 2020-07-01 at 7 05 33 PM

Both of syntax throw this error in Octane. Is there an alternative way to achieve this, or am i doing something wrong

@vishwasraj-thyagaraj
Copy link
Author

The solution for now is to remove getDependentsFor and add volatile: true, which re-computes all other dependent values from model when one value changes in the model

const Validations = buildValidations({
	key1: validator('validator-name', { volatile: true }),
	key2: validator('validator-name', { volatile: true })
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant