fix: remove <noscript> when static content is generated and rendered already
This commit is contained in:
committed by
Stefan Rotsch
parent
3dcb9075b7
commit
8876d3b1c7
@@ -67,6 +67,12 @@ const createStaticFiles = async () => {
|
||||
|
||||
rootEl.appendChild(headlineNode);
|
||||
rootEl.appendChild(textNode);
|
||||
|
||||
// remove the <noscript> element as page has already been hydrated with static content
|
||||
const noscriptEl = document.getElementsByTagName("noscript");
|
||||
if (noscriptEl[0]) {
|
||||
noscriptEl[0].remove();
|
||||
}
|
||||
} else {
|
||||
console.warn(
|
||||
'Element with ID "root" not found. Static site content will be empty.'
|
||||
|
||||
Reference in New Issue
Block a user