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

Uncaught TypeError: Illegal constructor on classList #2445

Closed
yoshkinawa opened this issue Nov 3, 2020 · 2 comments
Closed

Uncaught TypeError: Illegal constructor on classList #2445

yoshkinawa opened this issue Nov 3, 2020 · 2 comments
Labels
service Relates to an Origami service

Comments

@yoshkinawa
Copy link

yoshkinawa commented Nov 3, 2020

This is a bug report

I got an error on Explorer 11: "Uncaught TypeError: Illegal constructor on classlist"
after running this code on my website:
elmnt.classList.remove( className );

It also happend after this code:
document.body.classList.add( 'rtlJs' );

I can't reproduce this error on my IE11.
This happened only to other users (maybe it is a different build of IE11).
This is the user agent: 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko'

I saw it was already reported in the past: (#1692)

@origamiserviceuser origamiserviceuser added this to incoming in Origami ✨ Nov 3, 2020
@github-actions github-actions bot added the service Relates to an Origami service label Nov 3, 2020
@JakeChampion
Copy link
Collaborator

Hi @yoshkinawa, what is the full polyfill.io url you are using to load in the polyfills?

Also, could you write a small page on https://jsbin.com/ which replicates the bug, that way we can hopefully help figure out the root cause of this issue you are seeing :-)

@yoshkinawa
Copy link
Author

yoshkinawa commented Nov 3, 2020

I use this: https://cdn.polyfill.io/v2/polyfill.min.js

Here is a small script I wrote.
I've included other pollyfill libraries I used, in case they may have caused conflicts.
I could not replicate the error though.

<script src="https://cdn.jsdelivr.net/npm/svgxuse@1.2.6/svgxuse.min.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>

<div id="div" class="originalClass">hellow world</div>
    
<script>

       var div = document.getElementById('div');

       div.classList.add( 'testClass' );
       console.log( div.classList );

       div.classList.remove( 'testClass' );
       console.log( div.classList );

       document.body.classList.add( 'bodyClass' );
       console.log( document.body.classList );

</script>

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
@robertboulton robertboulton removed this from Backlog in Origami ✨ Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service Relates to an Origami service
Projects
None yet
Development

No branches or pull requests

2 participants