Questions tagged [angular10]

Questions about Angular version 10, the web framework from Google. Use this tag for Angular questions which are specific to only version 10. Use tag Angular for any Angular questions which are not specific to an individual version

Breaking Changes:

  • Typescript 3.6, 3.7, and 3.8 are no longer supported. update to Typescript 3.9.
  • Input fields of type number fire the valueChanges event only once per value change (as opposed to twice in some cases). See PR 36087.
  • The minLength and maxLength validators only validate values that have a numeric length property. See PR 36157.
  • Templates with unknown property bindings or unknown element names now log errors instead of warnings. See PR 36399.
  • UrlMatcher can now return null values. See PR 36402.
  • Transplanted views now refresh at insertion point only. See PR 35968.
  • Formatting times with the b or B format codes now supports time periods that cross midnight. See PR 36611.
  • Navigation is canceled for routes with at least one empty resolver. See PR 24621.

See the changelog for latest version information.

Read more at the Angular Website

837 questions
147
votes
14 answers

Property 'replaceAll' does not exist on type 'string'

I want to use replaceAll in typescript and angular 10. But I get this error: Property 'replaceAll' does not exist on type 'string'. This is my code: let date="1399/06/08" console.log(date.replaceAll('/', '_')) Output: 13990608 How can fix my…
behroozbc
  • 1,992
  • 2
  • 12
  • 25
124
votes
1 answer

Angular 10 Upgrade - Fix CommonJS or AMD dependencies can cause optimization bailouts

I am trying to upgrade my Angular 9 app to Angular 10 version, but getting below warning after the upgrade WARNING in calendar.reducer.ts depends on lodash/keys. CommonJS or AMD dependencies can cause optimization bailouts. I have added below line…
RRR
  • 3,509
  • 4
  • 29
  • 38
94
votes
19 answers

Unbound breakpoint - VS Code | Chrome | Angular

I have an Angular application that I am trying to debug in VS Code. When I compile and run the application (ng serve) the breakpoints are bound: However, when I specify a different configuration e.g. -c qa or -c uat they are unbound: Why are the…
35
votes
12 answers

Errors after npm audit fix angular 10.0.1

I ran this older 10.0.1 angular project today, and it told me it had a lot of low vulnerabilities and a few high ones. so i ran npm audit fix to fix them. but now when I try to run it, it gives me these errors: Error: ./src/main.ts Module build…
RTman
  • 453
  • 1
  • 4
  • 5
27
votes
4 answers

resolveJsonModule not functioning with Angular 10?

I have a basic JSON file in my assets folder of a brand new Angular 10 project. Angular CLI: 10.0.1 Node: 14.5.0 OS: win32 x64 TSC version 3.9.5. In my tsconfig.json I have "compilerOptions": { "module": "commonjs", "resolveJsonModule":…
Melvin Gruschow
  • 293
  • 1
  • 3
  • 9
26
votes
1 answer

Application installed by NPM (eg File C:\Users\name\AppData\Roaming\npm\ng.ps1) cannot be loaded because running scripts is disabled on this system

When running commands installed by npm (i.e. yarn, ng, etc.), I receive the following error: File C:\Users\\AppData\Roaming\npm\ cannot be loaded because running scripts is disabled on this system. where is one…
Esraa Alattar
  • 1,141
  • 1
  • 7
  • 9
26
votes
3 answers

o.Subject is not a constructor - Angular 10

Ng serve and ng build --prod command working fine, but when I deploy the app on serve that time below error occurs:- TypeError: o.Subject is not a constructor at new e (vendor-esnext.js:1) at Object.useFactory (vendor-esnext.js:1) at Object.i [as…
Jay Senghani
  • 265
  • 1
  • 3
  • 9
16
votes
2 answers

Angular: Running ngcc causing performance issues in VSCode

In my Visual Studio Code editor after last updates I see this text in the status bar: Angular: Running ngcc for project d:/..../tsconfig.spec.json It looks like frozen or do nothing a while, just spin the arrows. Before this text I saw a similar…
netdjw
  • 5,419
  • 21
  • 88
  • 162
13
votes
2 answers

Angular Property 'offsetWidth' does not exist on type 'Element'

new to angular, I am trying to use ScrollTrigger for horizontal scroll. It work, but when I serve or build I got the error : Property 'offsetWidth' does not exist on type 'Element'. This is the code for the gsap : gsap.to(sections, { xPercent:…
Jérémie Czk
  • 131
  • 1
  • 1
  • 4
13
votes
5 answers

ERROR Error: Uncaught (in promise): TypeError: i.BehaviorSubject is not a constructor in Angular 10 SSR

I'm getting this issue after build successfully and run on browser with angular universal Here is my package json : { "name": "ssr", "version": "1.0.0", "private": true, "dependencies": { "@angular/animations": "10.0.5", …
11
votes
4 answers

Auto reload for clients after deploy with Angular 10

Currently, my application is deployed and all the js have the timestamp version. Now when I again build my angular app the js will have a new timestamp version. Is there a way where I can compare the version of my build and if it does not match…
Ritesh Maharjan
  • 315
  • 1
  • 4
  • 11
10
votes
5 answers

Angular Update 10.2 to 11

I'm trying to update Angular in my project from version 10.2 to 11.0. Running ng update: @angular-devkit/build-angular 0.1002.0 -> 0.1100.1 ng update @angular-devkit/build-angular @angular/cdk 10.2.7 -> 11.0.0 …
Kajetanoss
  • 159
  • 1
  • 2
  • 8
10
votes
4 answers

Using Angular custom web component throws error: The selector "app-root" did not match any elements

I have a normal Angular 10 application with lazy loaded modules and routing. However, I have a special requirement I need to fulfill. On most pages I want to initialize the full application with routing etc. by embedding the element in…
dude
  • 5,678
  • 11
  • 54
  • 81
10
votes
0 answers

Angular 10: Still recommending TSLint Or ESLint program?

Why is Angular 10 making its Default Lint Program TSLint, when its deprecated? Does Angular recommend TSLint or ESLint? https://angular.io/cli/lint https://palantir.github.io/tslint/
user14011623
9
votes
3 answers

Angular 10 Swagger Codegen: Generic type ModuleWithProviders requires 1 type argument(s)

I am generating https://editor.swagger.io/ Codegen proxies. It is giving the following error in Angular 10. How can this be fixed? Generic type 'ModuleWithProviders' requires 1 type argument(s). export class ApiModule { public static…
user13889515
1
2 3
55 56