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

IE11 - Error: Object doesn't support assign #9

Closed
godavem opened this issue Oct 13, 2018 · 2 comments
Closed

IE11 - Error: Object doesn't support assign #9

godavem opened this issue Oct 13, 2018 · 2 comments

Comments

@godavem
Copy link

godavem commented Oct 13, 2018

In IE 11, I'm getting this error message in the console: "Object doesn't support property or method 'assign' with this section of the code highlighted: "this.args=Object.assign({tid:e,cid:t},n)"

Possibly relevant additional context: I placed the minimized code directly into the header of my single page web app, like this:

<title>Blah</title> <script> !function(e,t){....);return n}(n)},n}); const ga = new GAnalytics('XX-XXXXXXX-X'); ga.send('pageview');

-Dave

@lukeed
Copy link
Owner

lukeed commented Oct 13, 2018

Hey Dave 👋

Right, this lib sorta relies on a build step so that you can automatically import a poly/ponyfill for Object.assign as needed. As of #2, I went with the generalized case since everything except IE supports it natively.

If you're inlining the script, you can use this helper (instead of relying on a builder/bundler), which 1.0.0 originally included:

function assign(tar) {
	var k, src, i=1;
	for (; i < arguments.length; i++) {
		src = arguments[i];
		for (k in src) tar[k] = src[k];
	}
	return tar;
}

@lukeed
Copy link
Owner

lukeed commented Oct 13, 2018

I'm happy to continue with any help you may need, but closing this since it's not something I'll revert moving forward. Hope you understand 🙇

Please reach out if you still need me!

@lukeed lukeed closed this as completed Oct 13, 2018
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