Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngsanitize error after migrating to angular 1.7.0 #16567

Closed
2 tasks
singireddy0598 opened this issue May 16, 2018 · 8 comments
Closed
2 tasks

ngsanitize error after migrating to angular 1.7.0 #16567

singireddy0598 opened this issue May 16, 2018 · 8 comments

Comments

@singireddy0598
Copy link

singireddy0598 commented May 16, 2018

I'm submitting a ...

  • [X ] bug report
  • feature request
  • other

Current behavior:
my application is not loading after angular released 1.7.0 version. We are using angular-sanitize in my our application. my application downloaded angular 1.7.0 version then correspondingly angular-sanitize is also downloaded with version 1.7.0(which is compatible with angular version 1.7.0).

angular.lowercase and angular.uppercase methods have been removed in 1.7.0 version However angular-sanitize with version 1.7.0 still has references to it and As a result my application is not loading with the below error

Error: [$injector:modulerr] Failed to instantiate module ngSanitize due to:
TypeError: lowercase is not a function

Expected / new behavior:
my application should load properly with angualr-sanitize version 1.7.0 and angular version 1.7.0. Could you make the necessary changes in angular-sanitize #1.7.0 version

Minimal reproduction of the problem with instructions:

AngularJS version: 1.7.0

Browser: all

Anything else:

@frederikprijck
Copy link
Contributor

Hi,

You're probably not using angular-sanitize 1.7, as it doesn't have references to angular.lowercase / angular.uppercase.

Could you verify you're using 1.7.0 ? If you are, please provide the exact stacktrace so we can debug what's going on. (or if possible, provide a reproduction using plunkr)

Thanks

@melbarch
Copy link

Hello,

after the upgrade to angular 1.7.0, we faced the same issue when loading the application :

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module ngSanitize due to:
TypeError: lowercase is not a function
    at toMap (http://localhost:5768/__hash__/app.min.js:46557:27)
    at new $SanitizeProvider (http://localhost:5768/__hash__/app.min.js:46533:18)
    at Object.instantiate (http://localhost:5768/__hash__/app.min.js:14923:14)
    at provider (http://localhost:5768/__hash__/app.min.js:14733:36)

if it could help, we are using angular-sanitize "[email protected]" (found it in .\node_modules\angular-sanitize\package.json)

@gkalpak
Copy link
Member

gkalpak commented May 16, 2018

As documented, you should always use the same version of AngularJS (angular) and external modules (angular-animate, angular-sanitize, etc).

@gkalpak gkalpak closed this as completed May 16, 2018
@singireddy0598
Copy link
Author

Hi frederikprijck,

Thanks for your response. I am using angular-sanitize 1.7 only . please find the below screen shot for the reference

image

There is one another user also faced the same issue I found on stack overflow

https://stackoverflow.com/questions/50213977/angularjs-ngsanitize-error

@gkalpak
Copy link
Member

gkalpak commented May 16, 2018

You must be either not using [email protected] or not [email protected]. In 1.7.0, lowercase() is exposed as a private helper (angular.$$lowercase()) and angular-sanitize has been updated to use that.

If you still believe there is bug in AngularJS, please post a minimal reproduction (ideally a live demo using Plnkr, CodePen, etc).

@dimkir
Copy link

dimkir commented Jul 9, 2018

Having the same symptoms. Just as Angular team suggested: I had been using not matching versions:

  • angular.js 1.7.2
  • angular-sanitize.js 1.6.9

My problem was incorrect constraint in the package.json (so @singireddy0598 maybe you should check your version constraints)

  "dependencies": {
    "angular": "1",  // this updated angular.js to 1.7.2
    "angular-animate": "1.6.10",
    "angular-route": "1.6.9",
    "angular-sanitize": "1.6.9",

@bike2live
Copy link

I'm getting this with angular 1.7.8 & angular-sanitize 1.7.8

@petebacondarwin
Copy link
Contributor

@bike2live - can you provide a reproduction of your problem, and place it in a new issue?

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

No branches or pull requests

7 participants