My Next.js app is not working on IE.
It shows the blank screen and throws syntax errors on console.
This is ok, with IE soon-to-be discontinued and all, but I want to prevent IE from executing the single line of code upon detecting the browser.
From this answer, I can check if the browser is IE:
if (window.document.documentMode) {
// IE detected
document.write('IE is not supported. Please use a modern browser!')
}
Instead of getting the blank screen, users see why the site is not working with the message above.
There are two questions with this approach:
- Where to put the code above in Next.js?
- How to terminate the app upon executing the code, or is that possible?
Any help would be appreciated.