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: (intermediate value).toLowerCase is not a function #12

Open
maxpower9000 opened this issue Mar 23, 2018 · 5 comments
Open

TypeError: (intermediate value).toLowerCase is not a function #12

maxpower9000 opened this issue Mar 23, 2018 · 5 comments

Comments

@maxpower9000
Copy link

Issue
Error message inside Firefox console:
TypeError: (intermediate value).toLowerCase is not a function.

The message appears on every pageload. Independent of any use of directive().
Just because the browser is loading the corner.js or corner.min.js.

The responsible line of code is:

element_class_list = (element.className || '').toLowerCase().split(' ');

My setup
corner.js 0.9.3 installed through Yarn
Firefox Developer Edition 60.0b5 on Win7 32bit WAMP-Server

@maxpower9000
Copy link
Author

Chrome 64 says:

Uncaught TypeError: (e.className || "").toLowerCase is not a function
    at element_loaded (corner.min.js:1)
    at element_loaded_wrapper (corner.min.js:1)
    at NodeList.forEach (<anonymous>)
    at itar (corner.min.js:1)
    at corner.min.js:1
    at Array.forEach (<anonymous>)
    at itar (corner.min.js:1)
    at MutationObserver.observe.childList (corner.min.js:1)

@Jabher
Copy link
Owner

Jabher commented Apr 1, 2018

Hello! Is it happening in some exact page/domain or all across the internet?

@maxpower9000
Copy link
Author

@Jabher Only tested on localhost.

I found some similar issues on SO:

Maybe the issue here also has to do with the automatic semicolon insertion ...

The ECMAScript specification has specific rules for automatic semicolon insertion, however in this case a semicolon isn't automatically inserted because the parenthesised expression that begins on the next line can be interpreted as an argument list for a function call.
This means that without that semicolon, the anonymous window.Glog function was being invoked with a function as the msg parameter, followed by (window) which was subsequently attempting to invoke whatever was returned.

@Jabher
Copy link
Owner

Jabher commented Apr 12, 2018

No, it's different. Can you please catch an error with the debugger and show what inside an "e"?
It should be some kind of HTMLElement.

Or, you can create some test page so I can debug it.

@jrussnone
Copy link
Contributor

I'm having this issue in a project as well. I found that if an SVG is parsed, the property className is actually an object not a string. I have a potential fix in #14

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

3 participants