ember-cp-validations icon indicating copy to clipboard operation
ember-cp-validations copied to clipboard

After update to ember 3.27.5 there is an error: Uncaught TypeError: (0 , _string.isHTMLSafe) is not a function

Open enterpub opened this issue 3 years ago • 5 comments

Fails on any page with validation

Uncaught TypeError: (0 , _string.isHTMLSafe) is not a function
    at unwrapString (utils.js:36)
    at Class.createErrorMessage (base.js:208)
    at Class.validate (ember-validator.js:14)
    at factory.js:366
    at factory.js:452
    at Array.map (<anonymous>)
    at generateValidationResultsFor (factory.js:430)
    at Class.<anonymous> (factory.js:365)
    at Class.<anonymous> (cycle-breaker.js:26)
    at index.js:1935

In utils.js (ember-cp-validations/utils/utils) fails on this line:

function unwrapString(s) {
    if ((0, _string.isHTMLSafe)(s)) { // <<<------ fails here
      return s.toString();
    }

    return s;
  }

How to fix this issue? Thank you

Environment

  • Ember Version: 3.27.5
  • Ember CLI Version: 3.27
  • Ember CP Validations Version: 4.0.0-beta.12

Steps to Reproduce

Any page where validation occures

enterpub avatar Aug 08 '21 12:08 enterpub

Emer-cp-validations still work with ember 3.26.1

enterpub avatar Aug 08 '21 16:08 enterpub

Please test this PR: #699.

yarn add -D lolmaus/ember-cp-validations#lolmaus:issue-698-isHTMLSafe

(Do not depend on the branch in production. The branch will be removed, and your builds will start failing. Create your own fork and depend on it instead.)

lolmaus avatar Sep 16 '21 07:09 lolmaus

@lolmaus , thank you for youer effort. I'll be able to check the fix later, at least in a week. I've looked at the changes you've made and I'm sure that should fix the issue

enterpub avatar Sep 16 '21 12:09 enterpub

Hi, wonder when the fix for this issue could be merged?

SunnyTong2019 avatar Nov 05 '21 17:11 SunnyTong2019

The project seems to be unmaintained.

lolmaus avatar Nov 05 '21 18:11 lolmaus

@enterpub that should be fixed in the new beta release so I guess we can close the issue.

fsmanuel avatar Aug 26 '22 10:08 fsmanuel

@fsmanuel I will check the fix next week, but I believe it may be closed. Thank you

enterpub avatar Aug 26 '22 12:08 enterpub

@enterpub I'm closing this. Feel free to reopen if there are still problems.

fsmanuel avatar Sep 10 '22 09:09 fsmanuel