The requested module ” does not provide an export named ‘default’ JavaScript

In the file TableCsv.js you are not making your object available for external files to use. The way that this is done is via the export statement. You can either export something (or several somethings) as named exports, so that you would need to import them with a statement like import { Thing } from … Read more

What is the purpose of template literals (backticks) following a function in ES6?

These are tagged template literals. The part before the backpacks is a reference to a function that will be called to process the string. The function is passed the variables (the ${} parts) as arguments as well as the pieces of the string that surround the variables broken into an array. The return value of … Read more

error TS: Property ‘dataset’ does not exists on type ‘Element’

The property dataset does not exist on type Element, but does exist on HTMLElement. You need to make sure it’s of this type before proceeding. It also works to adjust your for loop a bit: for (const timelineEl of timelineEls) { if (timelineEl instanceof HTMLElement) { const progress = self.getProgress(timelineEl); const timelineKey = timelineEl.dataset.scrollTimeline; // … Read more

Clicking an element on a page through Chrome Extension

Quoting the official documentation: Content scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, or make changes to them. So, using your content_script.js in your popup.html doesn’t make much sense, and results in … Read more

Calling a javascript function from another .js file

The problem is, that menuHoverStart is not accessible outside of its scope (which is defined by the .ready() callback function in file #1). You need to make this function available in the global scope (or through any object that is available in the global scope): function menuHoverStart(element, topshift, thumbchange) { // … } $(document).ready(function() { … Read more