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.

jotai breaks ie11 on nextjs with arrow function

See original GitHub issue

Hi, I am testing this great lib and found out it breaks ie11 on next js with the arrow function.

ie 11 reports this error:

SCRIPT1002: Syntax error

_app.js (11916,31)

And it points to this line of code:

const hasInitialValue = atom => 'init' in atom;

I understand jotai supports ie11. It seems its standard dist output doesn’t transpire arrow function.

Any idea how to transpire it to work with nextjs on ie11? Sorry if it is a naive issue. Couldn’t find an issue addressing this.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lanyusancommented, Jan 22, 2021

busy recently. Would twist nextjs config later. thanks anyway.

0reactions
dai-shicommented, Mar 15, 2021

Using https://github.com/martpie/next-transpile-modules I got it to run in IE11.

// next.config.js
const withTM = require('next-transpile-modules')(['jotai']);
module.exports = withTM();

Thanks for confirming. I guess this is a recommended solution at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nextjs10 not working in IE11 fine with all my arrow functions
I have a Nextjs10 webapp. This works fine in Chrome, Safari, Mozilla, but in IE11 the app doesnt work fine. All my arrow...
Read more >
Why does my ReactJS app not able to render in IE11?
we still wants to use Arrow Function, and even more, we may not want to change the code, as the issue lies on...
Read more >
Hasty Treat - Why should I use React Hooks? - Syntax.fm
With hooks, it makes you decouple what it does and how it looks. Makes things like GraphQL code gen possible; Multiple pieces of...
Read more >
sitemap-1.xml - LogRocket Blog
... https://blog.logrocket.com/anomalies-in-javascript-arrow-functions/ ... https://blog.logrocket.com/create-react-app-vs-next-js-performance-differences/ ...
Read more >
Untitled
... 2022-12-21 monthly https://www.infoq.com/jp/articles/apache-arrow-java/ ... https://www.infoq.com/jp/news/2021/06/microsoft-IE11-retired-june-2022/ ...
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