Encountering the following issue: "ERROR TypeError: Argument is required in IE 11"

The code below is functioning properly in all internet browsers except for IE11. When running the code in IE, an error is thrown stating "ERROR TypeError: Argument not optional." The project being developed is using Angular 10.

 private togglePageClass(mode: boolean) {
    if (mode) {
      document.getElementById('templateHolder')['classList'].add(...this.pageClass);
    } else {
      document.getElementById('templateHolder')['classList'].remove(...this.pageClass);
    }
  }

The value of the page class is set as follows:

 let Mode: string = this.pageLayout['settings']['mode'].split('-')[1];
    if (this.pageLayout['template'] === 'landing_page') {
      this.pageClass = [this.pageLayout['settings']['id'], 'page-landing'];
    } else if (this.getConfig('configSettings')['100'] === 'on') {
      if (this.pageLayout['settings']['mode'] === 'abc') {
        this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode, 'a'];
      } else if (this.pageLayout['settings']['mode'] === 'xyz') {
        this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode, 'b'];
      } else {
        this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode];
      }
    } else {
      this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode];
    }

I have made all necessary changes in the angular json and related files based on Angular.io guidelines to ensure that the app runs properly in IE 11.

Answer №1

Encountering a similar problem with the md-checkbox in angular-material on IE11 led me to make a simple adjustment to resolve it. The solution involved making a modification within document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null). By adding false as the fourth parameter, I successfully corrected the error.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Displaying Stats.js inside a different canvas using ThreeJS

Just starting out with Three.js and wanted to test displaying the Stats.js in a small scenario. Check it out here Decided not to use modules for now, but followed similar code structure as in the examples: var stats = new Stats(); var renderer = ...

Encountering a Problem with vue-check-view Library in Typescript

After successfully declaring the js plugin with *.d.ts, I encountered an issue where my view was blank after using .use(checkView). Does the library vue-check-view support Typescript? Error: Uncaught TypeError: Cannot read property '$isServer' o ...

Whenever I attempt to run my script, the console on replit fails to function properly

As a complete beginner to Javascript, I'm having trouble getting my script to respond when I try to execute it. It just moves on to the next line and waits for me to type 'node index.js' again. I've included 2 images in an Imgur album - ...

Executing function after completion of ajax call

I have 2 buttons and 3 links that trigger an ajax request. I want to display an alert only when the request initiated by one of the buttons is completed, but not when a link is clicked. Below is my code: HTML: <button id="ajax1">Ajax 1</button&g ...

Displaying search results seamlessly on the same page without any need for reloading

I am looking to create a search engine that displays results without the need to refresh the page. I have come across using hash as a potential solution, but I don't have much knowledge about web programming. So far, with the help of tutorials, I have ...

Unable to view flash elements in HTML using Django framework

Apologies for any errors in my English, I will do my best to explain clearly. I am new to working with Django and I have a html page with flash content called map.html. I would like to include this page into another page called soporte.html (which extends ...

Implementing a 12-month display using material-ui components

Just starting out with ReactJs, TypeScript, and material-ui. Looking to display something similar to this design: https://i.stack.imgur.com/zIgUH.png Wondering if it's achievable with material-ui. If not, any suggestions for alternatives? Appreciate ...

Bringing a JavaScript function into a TypeScript file results in it being treated as a namespace

Trying to bring a vanilla JavaScript function into a TypeScript file within a React Native app has presented some challenges. The import process goes smoothly when working with JS, but switching to TS triggers the error message: Cannot use namespace &apos ...

Is it possible to establish a condition for the component selector in Angular 2/4?

Is there a way to set conditions for a component selector? For example, let's say I have two simple components: First: @Component({ selector:'app-first' templateHtml: 'first.html; }) export class ...

Converting an array of floating point numbers into JSON format using JavaScript

After gathering and rounding geocoordinates in PHP, the expected results are as follows: Array( [0] => Array ( [0] => 37.76073 [1] => -122.439948 ) [1] => Array ( [0] => 37 ...

Is Chrome launching a list of links in separate windows instead of tabs?

As I create a customized start page for myself, I've encountered a challenge. I want to include a link above all sections that, when clicked, will open all pages in a new tab. However, I'm facing an issue where only the first link opens in a new ...

How can you update state with useState in React and perform additional actions in an onChange event?

I'm facing an issue with a component that includes another component (from headlessui/react) defined like this: export default function MyComponent(props) { const [selectedState, setState] = useState(''); return ( <div> & ...

What is causing the role="status" attribute to malfunction?

I'm having an issue with the role="status" attribute in my code. When using a screen reader, the paragraph text doesn't get read once it's appended to the body. index.html: <!DOCTYPE html> <html> <head> <title> ...

transferring information to a PHP page using JavaScript without using AJAX requests or form submissions

I am currently working on a PHP page where I receive POST data using some functions, without relying on AJAX for page refresh. At the moment, I have a form that includes hidden fields holding dynamic data, which is then sent using JS like this: document.m ...

Extracting <p> elements from a separate HTML file and cycling through them

I successfully created a website using only HTML, JavaScript, and jQuery without any server-side scripting or language. Within my website, I have a simple stream.html page that remains unstyled with no CSS formatting. <html> <head> </head& ...

Adding an object to an array in Angular 7: A step-by-step guide

Why am I facing issues while pushing an object into an array? This is how I am attempting to do it: this.passData = this.tribeForm.value; var id = {"tribe_id": 1} this.passData.push(id) Shown below is the value in the tribeForm https://i.sstati ...

Obtaining a HashTable using the ExecuteScript function in Selenium

When using Selenium WebDriver in C#, I can retrieve all HTML attributes for a specific tag at once by executing the following code: ReadOnlyCollection<object> HtmlAttributes = (ReadOnlyCollection<object>)((IJavaScriptExecutor)Driver).ExecuteSc ...

Issue with DragControls in Three.js not detecting intersections

My current challenge involves setting up DragControls in my Three.js project. After researching online, I found that the process should be quite simple. The code I have written is as follows: let dragObjects = [obj] const dragControls = new DragControls(dr ...

Steps to resolve the "Module not found" error when executing the npm run build command

When running the npm run build command in my application, I encountered a module not found error shown below: npm WARN npm npm does not support Node.js v16.17.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can&apos ...

Apologies, but there was an unexpected error: Uncaught (in promise): TypeError: Unable to access the 'customerName' property of an undefined

Check out the structure of my JSON file: { "total": 3, "items": [ { "id": "01", "data": { "customerName": "Jhon", "description": "..some content..", "price": "25000" ...