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

TypeError in Internet Explorer 11 because Object.assign doesn't exist there #3321

Open
mstum opened this issue Oct 10, 2018 · 8 comments
Open

Comments

@mstum
Copy link

mstum commented Oct 10, 2018

I'm using less.js version 3.8.1 in the Browser for local development (less.min.js from /dist from the 3.8.1 Release Source Zip), and in Internet Explorer 11 it throws a TypeError because Object.assign doesn't exist there. http://lesscss.org/usage/ says that IE11+ should be supported. Polyfilling Object.assign makes less.js work in Internet Explorer 11 as well.

Earlier Versions (upgraded from less.js 2.7.1) worked fine in IE.

image

@NickCraver
Copy link

To save some time, here's the PR that introduced the issue: #3301

ansuz pushed a commit to cryptpad/cryptpad that referenced this issue Jan 10, 2019
@stale
Copy link

stale bot commented Feb 7, 2019

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

@stale stale bot added the stale label Feb 7, 2019
@mstum
Copy link
Author

mstum commented Feb 7, 2019

Is commenting enough to make it un-stale? Not sure if there's anything else to do?

@stale stale bot removed the stale label Feb 7, 2019
@kevinramharak
Copy link

I guess it is 😄 About the contents of your post. The package.json shows a polyfill in the devDependencies. My guess is that the polyfill is injected during the test suite but not bundled with the distributed version.

@matthew-dean
Copy link
Member

IE11 is a low priority target, so this would be up-for-grabs to anyone to tackle.

@Olli-Suutari
Copy link

I have created a fix by checking for IE and including a polyfill.
See: https://gist.github.com/Olli-Suutari/5991619a5ea6ec7f9f036def075a729e

olli-suutari-jkl added a commit to olli-suutari-jkl/jyvaskyla.fi.kirjasto that referenced this issue Feb 22, 2019
- Added the possibility of customizing styles via parameters
- Fixed .less for IE 11, see: less/less.js#3321
- Improved resizing for opening modals
@ronniedude
Copy link

ronniedude commented Aug 1, 2021

While this polyfill may have worked when v3.8.x was new, as of July 2021, version 4.1.1 will still not work with IE11 after applying the polyfill for Object.assign() method.

Today's less-4.1.1 file uses other JS functions that don't exist in IE11, like Object.getOwnPropertySymbols() and native Promises.

I suggest this issue be closed as it's no longer in scope to today's code or possibly merged into an overarching IE11 non-support issue.

I'd also ask that this discussion doesn't devolve into whether or not IE11 is worth anybody's time. The lesscss.org site lists IE11 as a supported browser, and is still within support status from Microsoft for the time being.

@lubber-de
Copy link

Polyfill hint: Include this

<script src="https://polyfill.io/v3/polyfill.min.js?features=es5%2Ces2015"></script>

before including less.js, which should add all missing/needed features in case an incompatible browser (ie11 nowadays only) is used. The service will only return missing features so basically returns nothing when a modern browser is used. Should work with less 4.1.1 as well

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

No branches or pull requests

7 participants