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.

Syntax error in ie11 with nextjs

See original GitHub issue

Syntax error in ie11

-> class Dom7 ....

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:22

github_iconTop GitHub Comments

33reactions
catamphetaminecommented, Apr 17, 2019

So, you wouldn’t believe it but the “Swiper” library author @nolimits4web silently deleted my bug report from his repository: https://github.com/nolimits4web/swiper/issues/3047 Very childish, rude and unprofessional. I guess I’ll have to look for better alternatives to the “Swiper” library.

In the meantime, for everyone having their Internet Explorer broken by the “Swiper” library here’s the workaround I found that stops the “Swiper” library from breaking Internet Explorer:

  • Go to Webpack configuration (webpack.config.js).
  • Find babel-loader there.
  • Modify its exclude from /node_modules/ (the default on the internet) to /node_modules[\/\\](?!(swiper|dom7)[\/\\])/ (I saw the idea in react-id-swiper’s package.json).
  • Now Webpack bundles the website while also actually transpiling dom7 and swiper packages (doing the work the dom7/swiper library author should have done before releasing those untranspiled).

Internet Explorer is still a popular browser in some areas. Breaking it is unacceptable.

3reactions
Antonio-Lagunacommented, Sep 23, 2019

@mathishuettl FWIW I added a custom alias for swiper, something like this:

mix.alias({
    'swiper': 'node_modules/swiper/dist/js/swiper.js',
    'swipercss': 'node_modules/swiper/dist/css/swiper.min.css'
});

Not ideal, not the best but does the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SCRIPT1002: Syntax error in Next JS website in IE11 ...
If we try to see the problematic line of code then we can notice that it contains => Arrow functions . Arrow functions...
Read more >
IE11 & Next.js 12 version have syntax error with rewrites in ...
What example does this report relate to? with rewrites in next.config.js What version of Next.js are you using?
Read more >
Supported Browsers and Features - Next.js
If your own code or any external npm dependencies require features not supported by your target browsers (such as IE 11), you need...
Read more >
Any good guides on getting my app to run well in IE11? - Reddit
You open your app in IE11. Open the console. Check exactly where it broke. It (most likely) says „Syntax error“ or something is...
Read more >
Create React App IE11 : SCRIPT1002: Syntax Error How to ...
Create React App IE11 : SCRIPT1002: Syntax Error How to get rid of it. You've been living in a happy Disney land of...
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