Skip to content
New issue

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

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

Already on GitHub? # to your account

unsafe.replace is not a function #1335

Closed
tdespenza opened this issue Sep 24, 2016 · 2 comments
Closed

unsafe.replace is not a function #1335

tdespenza opened this issue Sep 24, 2016 · 2 comments
Labels

Comments

@tdespenza
Copy link

I'm using textAngular 1.5.10 and I'm getting this error below.

angular.js:13920 TypeError: unsafe.replace is not a function
    at taSanitize (http://localhost:9000/bower_components/textAngular/dist/textAngular.js:422:20)
    at Array._sanitize (http://localhost:9000/bower_components/textAngular/dist/textAngular.js:1840:37)
    at ngModelWatch (http://localhost:9000/bower_components/angular/angular.js:27810:36)
    at arguments.(anonymous function) (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1316:35)
    at Scope.$digest (http://localhost:9000/bower_components/angular/angular.js:17515:34)
    at Scope.scopePrototype.$digest (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1364:23)
    at Scope.$apply (http://localhost:9000/bower_components/angular/angular.js:17790:24)
    at Scope.scopePrototype.$apply (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1427:22)
    at done (http://localhost:9000/bower_components/angular/angular.js:11831:47)
    at completeRequest (http://localhost:9000/bower_components/angular/angular.js:12033:7)

Do I need to add another dependency other than the required dependencies listed here for the bower install?

@JoelParke
Copy link
Collaborator

I just added a small fix to remove this error. I won't be able to check this in for a day or two.

The changed code is:

            // we had an issue in the past, where we dumped a whole bunch of <span>'s into the content...
        // so we remove them here
        // IN A FUTURE release this can be removed after all have updated through release 1.5.9
        if (unsafe && unsafe.replace && (unsafe.replace instanceof Function)) {
            unsafe = unsafe.replace(rsb1, '');
            unsafe = unsafe.replace(rsb2, '');
            unsafe = unsafe.replace(rsb1, '');
            unsafe = unsafe.replace(rsb3, '');
        }

Which will fix the issue you are seeing.

@JoelParke JoelParke added bug and removed question labels Sep 28, 2016
JoelParke added a commit to JoelParke/textAngular that referenced this issue Sep 28, 2016
JoelParke added a commit that referenced this issue Sep 28, 2016
fix(factories): small fix for undefined unsafe.replace #1335
@JoelParke
Copy link
Collaborator

This is fixed with PR #1340.

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

No branches or pull requests

2 participants