Topic: SCRIPT1014: invalid character

Schulz pro asked 5 years ago


Recently I started using mdbootstrap. Everything works well in Chrome or Firefox but IE11 keeps firing errors. One of them is:
"SCRIPT1014: invalid sign" - mdb.js (15477, 23)

It should be this line:

let inputSelector = `${['text', 'password', 'email', 'url', 'tel', 'number', 'search', 'search-md'].map(function (selector) { return `input[type=${selector}]`; }).join(', ')}, textarea`;
I searched a bit and found out that IE11 doesn't support backticks as template literals. But this doesn't help me as I can't simply correct it (it's not my code). What can I do to get it working?

Stan Jansen free answered 5 years ago


Having the same issue on 4.5.13 using:

require('mdbootstrap/js/modules/file-input.js');


Cannot update to a higher version as they are missing the lightbox.js component.


Mikołaj Smoleński staff commented 5 years ago

Hi Stan,

Higher version of MDB also includes lightbox. Please update to the latest version to fix Your issue.

Best Regards


David Macek pro answered 5 years ago


I am having the same issue - SCRIPT1014: invalid character, version 4.5.15. When is this going to be solved? Many people still use IE  and it does not work on it.


Bartłomiej Malanowski staff commented 5 years ago

How can we recreate your issue? 


Schulz pro answered 5 years ago


I finally found a solution for the WOW component.  Maybe I will look into pickadate too. I published a snippet: snippet Now you can transpile the JS files using Babel and still use WOW. BUT: Don't use
<script>
new WOW().init();
</script>
Use
<script>
$('.wow').WOW();
</script>

Bartłomiej Malanowski staff commented 5 years ago

We've fixed that issue. Could you please re-download your package and check it?


Schulz pro answered 5 years ago


Thanks for your answer! Do you have any workarounds for me? Like I already said I managed to remove some errors by transpiling it using Babel. But this breaks (as I could see) two parts of the code which worked well in other browsers.
  1. the WOW component - it says it's undefined
  2. The pickadate - same thing (although I don't use it anywhere).
Wouldn't it be a nice idea to transpile your scripts before publishing? I think this would solve many problems with the IE. I would happily throw the Internet Explorer away but my product will be used in an environment where the Internet Explorer is heavily used so I depend on support for it.

Mikołaj Smoleński staff answered 5 years ago


Hi there, We are working on solving Your issue. We are aware that IE has still some users and it is important for You to keep the efficiency. Best Regards

Schulz pro answered 5 years ago


I just tried it with your landing-page.html. As it's an example made by mdb, it should work. It doesn't. To clarify this: it seems that the JS parts aren't working at all. I tried to transpile it using babel and it worked somehow. Unfortunately this breaks other stuff with mdb. I could upload a snippet but I think it's useless as you should have the code. https://imagebin.ca/v/4K7actln0kZZ I tried 4.5.13 for this picture. The result for 4.5.12 is the same. If it doesn't work when I try the example template out of the box, how in the world it can work at your PC? Once again I'm using Internet Explorer 11! Of course it works with other browsers.

Marta Wierzbicka staff answered 5 years ago


Hi, I'm opening new, clean MDB 4.5.12 or 13 package and I don't see this error. Please, specify what you try to create, provide any code example here: https://mdbootstrap.com/snippets/. I'll try to help if it will be possible. Best, Marta

Marta Wierzbicka staff answered 5 years ago


Hi, is that problem exist in the newest MDB 4.5.12 / 13 version? Please, try to update your 4.5.10 package to the newest one. Best, Marta

Schulz pro commented 5 years ago

I'm using 4.5.12 (it's not available in the version select)



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.10
  • Device: PC
  • Browser: Internet Explorer 11
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No