question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IE 11 SCRIPT5002: Function expected

See original GitHub issue

Describe the bug

IE 11 is showing SCRIPT5002: Function expected error pointing to this line: https://github.com/bootstrap-vue/bootstrap-vue/blob/2fb5ce823a577fcc2414d78bd43ed9e5351cb1c0/src/utils/dom.js#L110

Steps to reproduce the bug

  1. Create Vue project.
  2. Use bootstrap-vue
  3. Yarn serve
  4. Open in IE11.

Expected behavior

Working with no errors.

Versions

Libraries:

  • BootstrapVue: 2.0.0-rc.26
  • Bootstrap: 4.3.1
  • Vue: 2.6.10

Environment:

  • Device: PC
  • OS: Ubuntu
  • Browser: IE
  • Version: 11

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
tmorehousecommented, Aug 9, 2019

Make sure you are loading the latest polyfills for IE11

What polyfills are you including in your code? core-js? polyfill.io? @babel/polyfill?

The docs site uses BootstrapVue, and it runs fine on IE11 (note we are including the polyfill.io polyfills)

https://bootstrap-vue.js.org/docs#browser-support

The Following features and APIs are used by BootstrapVue:

  • Array.from(), Array.isArray(), Object.assign(), Object.is(), etc.
  • Promise
  • MutationObserver
  • IntersectionObserver (optional)

If you want to support older IE, Android, and iOS device web browsers, you may want to use core-js and intersection-observer:

npm install core-js regenerator-runtime intersection-observer

Import the polyfills in your app main entry point:

import 'core-js/stable' import 'regenerator-runtime/runtime' import 'intersection-observer' // Optional import Vue from 'vue' import BootstrapVue from 'bootstrap-vue'

Alternatively, use Polyfill.io to dynamically serve browser specific polyfills via <script> tags in the HTML <head> section.

<!-- Load polyfills to support older browsers --> <script src="//polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver" crossorigin="anonymous"></script>

0reactions
tmorehousecommented, Nov 1, 2019

It’s great rather than always sending polyfills to all browsers, even if they don’t need them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"SCRIPT5002 function expected" error in IE - Stack Overflow
i am facing an issue and getting error like "SCRIPT5002 function expected" in internet explorer 7-9. this ...
Read more >
Function expected in Internet Explorer When my page loads it ...
Function expected in Internet Explorer When my page loads it gives error function expected? ; text/javascript"> $( ; function () { $( ;...
Read more >
"SCRIPT5002 function expected" error in IE - - Bountysource
When I try to use vue-material for my application, I get a blank page in IE (IE 11) and the following error in...
Read more >
JS Error in Internet Explorer 11 SCRIPT1006: ')' expected
Hi, your plugin does not seem to work in Internet Explorer 11 (IE11). This error breaks the code: SCRIPT1006: ')' expected frontend.js (126,36)....
Read more >
JavaScript localStorage object broken in IE11 on Windows 7 ...
This works perfectly well in all my installed browsers except for IE11. An error occurs on the first line 'SCRIPT5002: Function expected'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found