最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - export 'isFakeTouchstartFromScreenReader' was not found in '@angularcdka11y' - Stac

programmeradmin3浏览0评论

I suddenly get the following errors in my Angular 11 project:

Error: ./node_modules/@angular/material/fesm2015/core.js 1091:45-77
"export 'isFakeTouchstartFromScreenReader' was not found in '@angular/cdk/a11y'

Error: ./node_modules/@angular/material/fesm2015/menu.js 786:17-49
"export 'isFakeTouchstartFromScreenReader' was not found in '@angular/cdk/a11y'

What I tried:

ng add @angular/material
npm i @angular/material
npm i

I suddenly get the following errors in my Angular 11 project:

Error: ./node_modules/@angular/material/fesm2015/core.js 1091:45-77
"export 'isFakeTouchstartFromScreenReader' was not found in '@angular/cdk/a11y'

Error: ./node_modules/@angular/material/fesm2015/menu.js 786:17-49
"export 'isFakeTouchstartFromScreenReader' was not found in '@angular/cdk/a11y'

What I tried:

ng add @angular/material
npm i @angular/material
npm i
Share asked Apr 6, 2021 at 12:47 MunchkinMunchkin 1,0955 gold badges30 silver badges64 bronze badges 3
  • I am getting the same error using angular 11.2.0. I tried running npm i @angular/cdk but I'm still getting this issue. – franzke Commented Apr 8, 2021 at 12:09
  • @franzke you should try removing node_modules as Remco suggested as well. And try using ng add @angular/material – Munchkin Commented Apr 9, 2021 at 12:04
  • I fixed it by updating angular packages via ng update @angular/cli @angular/core @angular/cdk --force --create-mits – doptrois Commented May 4, 2021 at 10:47
Add a ment  | 

2 Answers 2

Reset to default 5

All you need to is npm i @angular/cdk. It appears to be a version mismatch and the mand above should update the cdk to the corresponding version. Please correct me if I'm wrong/it changes.

I got this too when messing around with versions. Throw away node_modules folder, make sure your versions in package.json are in sync, and npm i

发布评论

评论列表(0)

  1. 暂无评论