angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

.find() polyfill is needed #3725

Closed LoveMeWithoutAll closed 4 years ago

LoveMeWithoutAll commented 5 years ago

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.

This is a (check one box):

My version of UI-Router is: 1.0.19(current stable lastest)

Bug Report

Current Behavior:

I am using angular-ui-router with Angular1 and ocLazyLoad. In Internet Explorer11, I am getting the below error message while instantiate module ui.router.

SCRIPT5022: [$injector:modulerr] Failed to instantiate module majorApp due to:
Error: [$injector:modulerr] Failed to instantiate module ui.router due to:
Error: [$injector:modulerr] Failed to instantiate module ui.router.init due to:
TypeError: Object doesn't support property or method 'find'
   at getParamDeclaration (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:1603:9)
   at Param (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:1667:13)
   at ParamFactory.prototype.fromConfig (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:5044:13)
   at makeConfigParam (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:2732:59)
   at Anonymous function (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:515:50)
   at forEach (https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.js:401:11)
   at map (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:515:9)
   at paramsBuilder (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:2734:13)
   at Anonymous function (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:2929:105)
   at StateBuilder.prototype.build (http://unpkg.com/@uirouter/angularjs/release/angular-ui-router.js:2930:17)

For solving this problem, I added the below polyfill script.

<script src="//cdn.polyfill.io/v2/polyfill.min.js?features=default,MutationObserver"></script>

So it works.

Expected Behavior:

I think working without polyfill is needed as the last version v1.0.18.

Link to Plunker or stackblitz that reproduces the issue:

( if you want a response to your issue, provide a way to reproduce it ) ( http://bit.ly/UIR-Plunk1 ) ( https://stackblitz.com/edit/ui-router-angularjs )

Feature Request

(type feature request here)

General Query

Please direct general implementation questions to StackOverflow: http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router

Please review the Sample Application which highlights common approaches: https://github.com/ui-router/sample-app-angularjs

(type general query here)

LoveMeWithoutAll commented 5 years ago

To resolve this error, polyfill is needed.

This post could be helpful

ThomasStubbe commented 5 years ago

+1

brennaveen commented 5 years ago

Your solution did not work for me. I had to use this polyfill from mozilla.org

mattdsteele commented 5 years ago

This has been fixed in core, but is waiting on ui-router/core@66a3244 to ship.

See ui-router/core#215

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.

LoveMeWithoutAll commented 4 years ago

This problem was Fixed version 1.0.20