这是indexloc提供的服务,不要输入任何密码
Skip to content

includes() javascript function does not work on Internet Explorer #6953

@GuiF73

Description

@GuiF73
Overview of the issue

On jHipster v4.13.x, with Internet Explorer, I cannot navigate to entities page, because of a bug in javascript function :
EXCEPTION: Object doesn't support property or method 'includes'
Stacktrace suggests hasAnyAuthorityDirect function from src/main/webapp/app/shared/auth/principal.service.ts :

hasAnyAuthorityDirect(authorities: string[]): boolean {
[...]
        for (let i = 0; i < authorities.length; i++) {
            if (this.userIdentity.authorities.**includes**(authorities[i])) {
                return true;
            }
        }
[...]
}

Transpiled the same way in JS.

Motivation for or Use Case

Impossible to navigate on these pages with Internet Explorer 11, and I guess all version of Internet Explorer : Can I Use includes functions

Reproduce the error

With last version of jHipster, just generate a simple app and try to navigate to entities page. Nothing happen !

Related issues

I look for something about polyfills and Internet explorer, but nothing found :/

Suggest a Fix

Add 'core-js/es7/arrays' in polyfills.
Found the way to fix here : angular/angular-cli#4128

JHipster Version(s)

Tested on 4.13.1

JHipster configuration

Not relevant

Entity configuration(s) entityName.json files generated in the .jhipster directory

Not relevant

Browsers and Operating System

Internet Explorer 11 is KO. Edge is OK. Google is OK.
See this : Can I Use includes functions

  • Checking this box is mandatory (this is just to show you read everything)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions