Uncaught Typeerror: (Intermediate Value)(...) Is Not a Function

Uncaught TypeError: (intermediate value)(...) is not a function

The error is a result of the missing semicolon on the third line:

window.Glog = function(msg) {
console.log(msg);
}; // <--- Add this semicolon

(function(win) {
// ...
})(window);

The ECMAScript specification has specific rules for automatic semicolon insertion, however in this case a semicolon isn't automatically inserted because the parenthesised expression that begins on the next line can be interpreted as an argument list for a function call.

This means that without that semicolon, the anonymous window.Glog function was being invoked with a function as the msg parameter, followed by (window) which was subsequently attempting to invoke whatever was returned.

This is how the code was being interpreted:

window.Glog = function(msg) {
console.log(msg);
}(function(win) {
// ...
})(window);

Uncaught TypeError: (intermediate value)(…) is not a function, putting semicolon like I've read online is not working

You must do export default makePage; without the (). Using export default makePage(); exports makePage function returns that is undefined. So Try this:

function makeBackground() {
const background = document.createElement('div');
background.classList.add("background");
document.body.appendChild(background);
}
function navBar() {
const content = document.querySelector('#content');
const header = document.createElement('header');
const ul = document.createElement("ul");
const nav = document.createElement('nav');

content.append(header);
header.append(nav);
nav.append(ul);

const home = document.createElement('li');
home.setAttribute("id", 'home');
home.textContent = "Home";
ul.append(home);

const menu = document.createElement("li");
menu.setAttribute('id', 'menu');
menu.textContent = "Menu";
ul.append(menu);

const contact = document.createElement('li');
contact.setAttribute('id', 'contact');
contact.textContent = "Contact";
ul.append(contact);
}

function makePage() {
makeBackground();
navBar();
}

export default makePage;

TypeError: (intermediate value)(intermediate value)(intermediate value) is not iterable

looking at this code:

const [startDate, endDate] = filterValues?.dateRange

filterValues can be potentially undefined (looking at the optional chaining operator). You cannot destruct array value from undefined

if you put this in a browser console:

const filterValues = undefined
const [startDate, endDate] = filterValues?.dateRange

you will get the exact same error:

VM291:1 Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at :1:30

You need to either fallback to an empty array:

const [startDate, endDate] = filterValues?.dateRange ?? []

or not use array destructuring:

const dateRange = filterValues?.dateRange
const startDate = dateRange?.[0]
const endDate = dateRange?.[1]

TypeError: (intermediate value).parseFromString(...).replace is not a function

You are treating a DOMParser object as a string. That will not work.

You need to do something like this since it is not recommended you change valid HTML before parsing it