diff --git a/packages/form-core/src/validate/ValidateMixin.js b/packages/form-core/src/validate/ValidateMixin.js index ac40528c0..88fe89a1b 100644 --- a/packages/form-core/src/validate/ValidateMixin.js +++ b/packages/form-core/src/validate/ValidateMixin.js @@ -470,7 +470,7 @@ export const ValidateMixinImplementation = superclass => if (!(v instanceof Validator)) { // throws in constructor are not visible to end user so we do both const errorType = Array.isArray(v) ? 'array' : typeof v; - const errorMessage = `Validators array only accepts class instances of Validator. Type "${errorType}" found.`; + const errorMessage = `Validators array only accepts class instances of Validator. Type "${errorType}" found. This may be caused by having multiple installations of @lion/form-core.`; // eslint-disable-next-line no-console console.error(errorMessage, this); throw new Error(errorMessage); diff --git a/packages/form-core/test-suites/ValidateMixin.suite.js b/packages/form-core/test-suites/ValidateMixin.suite.js index fb6d1b8a7..06acf1902 100644 --- a/packages/form-core/test-suites/ValidateMixin.suite.js +++ b/packages/form-core/test-suites/ValidateMixin.suite.js @@ -70,7 +70,7 @@ export function runValidateMixinSuite(customConfig) { const stub = sinon.stub(console, 'error'); const el = /** @type {ValidateElement} */ (await fixture(html`<${tag}>`)); const errorMessage = - 'Validators array only accepts class instances of Validator. Type "array" found.'; + 'Validators array only accepts class instances of Validator. Type "array" found. This may be caused by having multiple installations of @lion/form-core.'; expect(() => { // @ts-expect-error putting the wrong value on purpose el.validators = [[new Required()]]; @@ -78,7 +78,7 @@ export function runValidateMixinSuite(customConfig) { expect(stub.args[0][0]).to.equal(errorMessage); const errorMessage2 = - 'Validators array only accepts class instances of Validator. Type "string" found.'; + 'Validators array only accepts class instances of Validator. Type "string" found. This may be caused by having multiple installations of @lion/form-core.'; expect(() => { // @ts-expect-error because we purposely put a wrong type el.validators = ['required'];