Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

string.prototype.startswith polyfill does not work in IE 11 #14922

Closed
Ajji11 opened this issue Jul 28, 2018 · 3 comments
Closed

string.prototype.startswith polyfill does not work in IE 11 #14922

Ajji11 opened this issue Jul 28, 2018 · 3 comments
Assignees

Comments

@Ajji11
Copy link

Ajji11 commented Jul 28, 2018

Bug Report

Ionic Info

Describe the Bug
A clear and concise description of what the bug is.

Although a polyfill exists on the project a .startswith function is throwing a 'Syntax' error in IE 11, preventing the website from loading.

Polyfill for string.prototype.startswith is in the project and works for every other string.startswith.

Steps to Reproduce
Include AWS-Amplify / AWS-Amplify-Angular in Angular project and use one of the modules. It adds ionic/core dependency which has this function causing the issue. In my case I used AmplifyService.api().

Related Code

function configFromURL() {
    const config = {};
    const win = window;
    win.location.search.slice(1)
        .split('&')
        .filter(entryText => entryText.startsWith('ionic:'))
        .map(entryText => entryText.split('='))
        .forEach(entry => {
        config[entry[0].slice(6)] = decodeURIComponent(entry[1]);
    });
    return config;
}

This line is causing the break: .filter(entryText => entryText.startsWith('ionic:'))

Expected Behavior
Polyfill should work and website should load in IE11

Additional Context
List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, screenshots, OS if applicable, etc.

@ionitron-bot ionitron-bot bot added triage and removed triage labels Jul 28, 2018
@manucorporat manucorporat self-assigned this Jul 29, 2018
@dertuerke
Copy link

Nope its not closed. Same error with Beta1

@Ajji11
Copy link
Author

Ajji11 commented Aug 2, 2018

@manucorporat - yes, I'm facing the same error. It's still trying to use string.startswith instead of the new function.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
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

3 participants