Open DonghyukJacobJang opened 3 years ago
Added this on the project initialization in order to fix this issue:
// Fix https://github.com/vercel/next.js/issues/17464
document
.querySelectorAll('head > link[rel="stylesheet"][data-n-p]')
.forEach((node) => node.removeAttribute('data-n-p'));
new MutationObserver((mutations) => {
mutations.forEach(({ target }) => {
const t = target as Element;
if (t.nodeName === 'STYLE' && t.getAttribute('media') === 'x') t.removeAttribute('media');
});
}).observe(document.head, { subtree: true, attributeFilter: ['media'] });
Let's add this to a list of gotchas. Should not be a part of the Boilerplate.
ISSUE https://github.com/vercel/next.js/issues/17464
SOLUTION https://github.com/Jam3/prj-2140-sonos-june-frontend/blob/develop/src/utils/hooks/use-transition-fix.js