For questions regarding programming in Angular specific to version 12. Please include all relevant tags on your question; e.g.,[Angular], [TypeScript], etc.
Questions tagged [angular12]
664 questions
8
votes
1 answer
can't run ng serve in development mode
I can't run ng servein development mode.
I've upgraded Angular v11 to v12. Since then, I have compiling delays and development mode appears to not be enabled.
I'm always getting this…

Cristian Oliveira
- 83
- 1
- 4
8
votes
2 answers
Angular 12 upgrade issue : You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file
I have upgraded from Agular 11 to 12 getting below error for each SVG file.
Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
SVG…

ash
- 81
- 1
- 3
8
votes
2 answers
after upgrading to angular 12, all material components are "not a known element"
After upgrading to Angular 12, although I have all the required code in app.module.ts, all the material tags are not recognized: for example, for mat-checkbox, I have the following in app.module.ts
import { MatCheckboxModule } from…

bruno
- 91
- 3
7
votes
0 answers
Angular12 Upgarde: Warning: 1 rules skipped due to selector errors: .k-input-label:dir(rtl) -> unmatched pseudo-class :dir
I have upgraded my application to Angular 12.But getting a below warning while running ng serve
Warning: 1 rules skipped due to selector errors:
.k-input-label:dir(rtl) -> unmatched pseudo-class :dir)
Whereas no .k-input-label:dir(rtl) is being used…

firdoushj
- 71
- 3
7
votes
1 answer
How to use Global extension in Angular?
On an Angular 12 application I created the following extension:
declare global {
interface String {
toNumber(): number | null;
}
}
Object.defineProperty(String.prototype, "toNumber", {
value: function(this: string) {
return…

Miguel Moura
- 36,732
- 85
- 259
- 481
7
votes
4 answers
Error - Should not import the named export
I have updated my Angular project to version 12.0.5 and Typescript version to 4.3.4 and I am having trouble compiling the project.
Currently I get the following error without having made changes to the branch:
Should not import the named export…

six
- 87
- 1
- 1
- 7
7
votes
2 answers
Module parse failed: Unexpected character '�' After updating to angular 12
After upgrading Angular from v.11 to v.12 I am getting the following Error
home.Component.ts
imgname= require("../assets/images/imgname.png");
./src/assets/images/imgname.png:1:0 - Error: Module parse failed: Unexpected character '�' (1:0)
You may…

Vignesh
- 2,378
- 3
- 25
- 48
7
votes
4 answers
One or more import cycles would need to be created to compile this component, which is not supported by the current compiler configuration
I have an old angular library and when I migrate to angular 12 and try to build my library I am getting the below error:
projects/namespace/lin-folder/src/lib/components/alerts/alerts.component.ts:7:1
7 @Component({
~~~~~~~~~~~~
…

Aniruddha Das
- 20,520
- 23
- 96
- 132
6
votes
1 answer
ERROR in @types/ws trying to update from angular 12 to angular 13
I have updated my project from angular 12 to angular 13 and I'm facing this error:
Error: node_modules/@types/ws/index.d.ts:328:18 - error TS2315: Type 'Server' is not generic.
328 server?: HTTPServer | HTTPSServer | undefined;
…

Thiago Nascimento
- 152
- 1
- 9
6
votes
3 answers
FormControlName must be used with a parent FormGroup directive when FormGroup is passed to child component
Parent Component
In Radio Component html
in .ts of Radio component
export…

Veera
- 101
- 1
- 4
6
votes
4 answers
How to unit test window.location.reload in angular 12 unit testing?
In my angular project, I have a function
reloadPage(): void {
window.location.reload();
}
So when ever I need to reload the page, I used to call this function.
Now I am trying to add the unit testing for this function but it is not…

Arun
- 3,640
- 7
- 44
- 87
6
votes
5 answers
Angular 12 update issue: Unknown error from PostCSS plugin
Hi after I ran "ng update @angular/core@12 @angular/cli@12" to upgrade from 11 to 12, and then "ng serve app" I keep getting the following error:
"Unknown error from PostCSS plugin. Your current PostCSS version is 8.2.14, but postcss-preset-env uses…

Telly Ipock
- 133
- 3
- 12
5
votes
1 answer
Angular "partial" vs "full" compilation mode?
Why the library compiled in the "partial" compilation mode builds so slowly inside of the consumer application, compared to the "full" compilation mode?

nikola.maksimovic
- 707
- 8
- 12
5
votes
2 answers
Angular - How to implement switchMap for multiple http requests?
In my project, I sometimes want to update the available options in a list when the user changes the selected value in another list. To do this, I've used valueChanges with the pipe operator and switchMap like…

Chris
- 1,417
- 4
- 21
- 53
5
votes
0 answers
Unit test cases are not running after upgrading to Angular 12
Upgraded project from Angular version 5 to 12. The project is running fine but the unit test cases are not running, and just showing
Karma v 6.3.17 - connected; test: execute;
PhantomJS 2.1.1 (Windows 8) is idle
Chrome 99.0.4844.74 (Windows 10) is…

ATP
- 51
- 1