The Angular error occurred while trying to apply the CSS classes for high contrast mode in the body

Hey there

Anybody facing a problem after updating to Angular 11 with the updated @angular/material, encountering this error:

TypeError: Cannot read property '_applyBodyHighContrastModeCssClasses' of undefined
at new e (main-es2015.c8f294f80a15c1c3f55b.js:1)
at Object.o [as factory] (main-es2015.c8f294f80a15c1c3f55b.js:1)
at vs.hydrate (main-es2015.c8f294f80a15c1c3f55b.js:1)
at vs.get (main-es2015.c8f294f80a15c1c3f55b.js:1)
at main-es2015.c8f294f80a15c1c3f55b.js:1
at Set.forEach (<anonymous>)
at vs._resolveInjectorDefTypes (main-es2015.c8f294f80a15c1c3f55b.js:1)
at new zu (main-es2015.c8f294f80a15c1c3f55b.js:1)
at qu.create (main-es2015.c8f294f80a15c1c3f55b.js:1)
at main-es2015.c8f294f80a15c1c3f55b.js:1

I have tried removing package-json and reinstalling npm, but unfortunately, the error still persists.

Here are the package versions I am using:

@angular/material, @angular/cdk: 11.2.4

@angular/cli: 11.2.4

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

Error: Please note that the loading of the style/types.scss file in the dist build

I am facing an issue with including a general style/types.scss file in the dist folder. Despite having what seems to be correct rules, I cannot locate the content of the file in the build output. What steps can I take to debug this problem and investigate ...

TypeScript - Indexable Type

Here is an explanation of some interesting syntax examples: interface StringArray { [index: number]: string; } This code snippet defines a type called StringArray, specifying that when the array is indexed with a number, it will return a string. For e ...

Creating a file logging system with log4js to capture Console logs

Is there a way to automatically log all console logs, including failed expectations and exceptions, to a file without using try and catch in JavaScript? In Java's LOG4j, the rootlogger feature does this by default. Is there a similar functionality ava ...

When using NextJS <Link, mobile users may need to tap twice to navigate

Whenever I use the NextJS <Link tag on my mobile device, I notice that I have to double-tap for the link to actually route to the desired page. Take a look at the code snippet below: <Link href="/methodology" passHref={true} ...

Specifying the return type of a function as a combination of the types of the input arguments

Is there a way to safely implement the given function in TypeScript without using unsafe casts or an extensive number of function overloads with various input permutations? interface Wrapped<T> { type: string; data: T; } interface WrappedA&l ...

Retrieving the value of a selected option in Angular

I have the following dropdown select in my HTML and I am currently retrieving the text content of the selected option. How can I access the value attribute instead? Here is the dropdown select: <form [formGroup]="angForm" class="form-inline my-5 my-l ...

I am struggling to grasp the syntax for defining xpath in typescript language

Display the text of the first TextView element within a nested hierarchy of Android widgets using the xpath provided. ...

Mistakes encountered following the installation of lodash in Angular 2

After adding lodash to my Angular 2 project, I encountered a significant number of errors. To troubleshoot, I created a new project using the CLI: ng new tester, then I added lodash with npm install --save @types/lodash. When I ran ng serve, I received the ...

Learn how to dynamically chain where conditions in Firebase without prior knowledge of how many conditions will be added

Currently, I am working on a project using Angular and firebase. My goal is to develop a function that can take two arguments - a string and an object, then return an Observable containing filtered data based on the key-value pairs in the object for a spe ...

The @Column('decimal') decorator in TypeOrm with Postgres and NestJs is displaying a string instead of a decimal value

When I have columns with type decimal and I am using query builder for aggregation, I face an issue where the decimal values are returned as strings after executing the query. I am looking for a way to globally set my project to recognize decimal numbers ...

Issues with implementing Bootstrap icons in Angular are hindering functionality

As a beginner in Angular, I am currently working on creating a simple website using Angular and a Bootstrap template. However, I have encountered many issues along the way. Right now, I am struggling to utilize Bootstrap icons in my project. It appears tha ...

Steps for numbering a list with multiple ngfors within a div using Angular

How can I ensure that multiple ngfors output an undefined number of results listed in a specific format with incremental numbering? EXPECTED OUTPUT: 1. Object 1 News: Object 1 Stuff 2. Object 1 News: Object 1 Stuff 3. Object 1 News: Object 1 Stuff ...

Error in Angular 2: Uncaught Promise TypeError - Unable to access property 'title' of undefined

Whenever I attempt to include a text input field with dual binding in my App, the following error pops up: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'title' of undefined TypeError: Cannot read property 'title&ap ...

Encountering problem when attempting to incorporate fade in/fade out effect animation

I have a webpage that features multiple buttons, each triggering a fade-in/fade-out animation when clicked. This animation also involves changing the contents of a specific div. Though everything is functioning properly, there is a brief moment (about hal ...

Unable to retrieve the data property from the Axios response object following a successful GET request: The property 'data' is not present in the type 'void'

Currently, I am working on a personal project using React and TypeScript to enhance my skills. However, I have encountered a puzzling error in the following code snippet, which involves using Axios to fetch data: const fetchItem = async () => { const ...

Replace i18next property type in React for language setting

We have decided to implement multilanguage support in our app and encountered an issue with function execution. const someFunction = (lang: string, url: string) => any If we mistakenly execute the function like this: someFunction('/some/url', ...

What is the best way to center align the placeholder in an ion-input field?

What is the best way to center align the placeholder in ion-input? Here's a screenshot of my current ionic input fields with left alignment. I've attempted to move the alignment to the center, but I've been unsuccessful. Can someone please ...

What is the best way to modify a particular internal route parameter within Angular 2?

In the midst of creating a versatile calendar that can showcase various types of data, I have devised a unique URL structure to guide me: todo/2017/01/01 showcases daily todos birthdays/2017/01/01 displays birthdays for that particular day todo/2017/01 g ...

Tips for resolving the "Access-Control-Allow-Origin" problem in Angular2 with Lite-Server

I am working on an Angular 2 application that interacts with an external API to fetch data. Unfortunately, I do not have the authority to modify the API code. However, I can make changes to the TypeScripts and Lite-Server configuration. Encountered Error ...

Tips for adding maximum and minimum attributes to number input type in Ionic 3 and Angular 4 without utilizing form tags

Is it possible to define minimum and maximum values ranging from 0 to 1 for an ion-input component in Ionic 3 with Angular 4? https://i.sstatic.net/4aJMb.png ...