Next.js doesn't work properly in Safari
See original GitHub issueWhen I try to run my next app on Safari, I get this error in the console and it makes the app not function properly.
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
System information
- OS: macOS
- Browser: Safari Version 9.1.2 (11601.7.7)
- Version of Next.js: 6.1.0
Additional context
I’ve searched online and found the same issue with no solution, the only reasonable solution was to use babel.js - browser targets
, however that breaks the app badly and it doesn’t even build.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Why my nextjs app doesn't work on Safari? - Stack Overflow
I'm developing a web app using nextjs. Everything works just fine on every browser, except for Safari on Mac. This is what I...
Read more >Supported Browsers and Features - Next.js
Supported Browsers and Features. Next.js supports modern browsers with zero configuration. Chrome 64+; Edge 79+; Firefox 67+; Opera 51+; Safari 12+ ...
Read more >ReactJS web app renders blank page on iPhone
The web app functions normally on every user device except on iPhone users, both chrome and safari render a blank page. I've tried...
Read more >NextJS website not working on iOS devices - Reddit
This likely has nothing to do with Next.js. If the appearance is wrong on iOS devices, then you almost certainly have broken styling...
Read more >React/Next.js site doesn't load properly in Safari (blank page)
[Solved]-React/Next.js site doesn't load properly in Safari (blank page)-Reactjs ... For me it was a simple hard refresh (CTRL + SHIFT + R)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just leaving this here for anybody who stumbles upon this same issue. I added this to my
next.config.js
file and everything works fine on Safari, it no longer includes theconst
keyword.What this does is transpile every js file imported in our app with our babel configuration. Looks like a very lazy fix but solves the problem for me.
Or use next-cookies npmjs.com/next-cookies