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

memoryLocationPlugin breaks in IE11 (ReactJs) #62

Closed
pinoniq opened this issue Jul 5, 2017 · 1 comment
Closed

memoryLocationPlugin breaks in IE11 (ReactJs) #62

pinoniq opened this issue Jul 5, 2017 · 1 comment

Comments

@pinoniq
Copy link

pinoniq commented Jul 5, 2017

When using the memomryLocationPlugin IE11 has the following error:

Object doesn't support this action

The culprit seems to be the commen/extend method called here:

    BaseLocationServices.prototype.url = function (url, replace) {
        if (replace === void 0) { replace = true; }
        if (isDefined(url) && url !== this._get()) {
            this._set(null, null, url, replace);
            if (this.fireAfterUpdate) {
                var evt_1 = extend(new Event("locationchange"), { url: url }); // THIS LINE BREAKS
                this._listeners.forEach(function (cb) { return cb(evt_1); });
            }
        }
        return buildUrl(this);
    };

extends comes from the common/common package where it falls back to:

function _extend(toObj) {
    return restArgs(arguments, 1).filter(identity).reduce(_copyProps, toObj);
}

I however have no idea myself why this is breaking in IE11

@elboman
Copy link
Member

elboman commented Jul 9, 2017

Ok, finally had some time to install a VM with win7/IE11 and do some testing. Turns out the error is triggered by this bit of code, as IE doesn't support custom events:

new Event("locationchange"), { url: url })

The fastest solution would be to polyfill it as mentioned here: https://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work

I've opened an issue in the core repo to continue the discussion there: ui-router/core#64

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

No branches or pull requests

2 participants