第一次使用 firestore 时出现此错误。根据我的研究,这似乎是 Ivy 的问题。我没有很多修改 tsconfig.app.json 的经验,这是我被指出的方向,遵循其他答案。
我能够从原始项目中修改的唯一一件事是使用 Angular Fire 6 而不是 5,这是我最初按照教程所做的。
这是 package.json:
{
"name": "language",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~9.0.1",
"@angular/cdk": "^9.0.0",
"@angular/common": "~9.0.1",
"@angular/compiler": "~9.0.1",
"@angular/core": "~9.0.1",
"@angular/fire": "^6.0.0-rc.1",
"@angular/flex-layout": "^9.0.0-beta.29",
"@angular/forms": "~9.0.1",
"@angular/material": "^9.0.0",
"@angular/platform-browser": "~9.0.1",
"@angular/platform-browser-dynamic": "~9.0.1",
"@angular/router": "~9.0.1",
"firebase": "^7.8.2",
"rxjs": "~6.5.4",
"rxjs-compat": "^6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": …Run Code Online (Sandbox Code Playgroud) 我正在学习 Angular Material 并且在从“@angular/material/button”导入 { MatButtonModule } 时出现此错误。
从我在其他答案中读到的内容来看,它看起来像是包兼容性问题,但我无法修复它。
这是完整的错误
ERROR in node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(30,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(128,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(129,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(134,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(135,9): error TS1086: An accessor cannot be declared …Run Code Online (Sandbox Code Playgroud) 我在 SO 中遇到了类似的错误,但是在安装、删除 node-modules、package-lock.json 再次安装后,我仍然无法摆脱错误:
./src/app/app.module.ts:8:0-63 - 错误:找不到模块:错误:包路径 ./module 未从包 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules 导出/@angular/flex-layout (请参阅 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@angular/flex-layout/package.json 中的导出字段)
{
"name": "stamp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/cdk": "^13.2.3",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/flex-layout": "^13.0.0-beta.38",
"@angular/forms": "~13.2.0",
"@angular/material": "^13.2.3",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"rxjs": "^6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.3",
"@angular/cli": "~13.2.3",
"@angular/compiler-cli": …Run Code Online (Sandbox Code Playgroud) 通过 VSCode 的源控制区域意外删除项目后,Omnisharp 完全停止工作。任何以前的项目和任何新创建的项目都不起作用。在 Visual Studio 上一切正常,所以我认为问题不在于 .NET Core 安装。我在 Mac 上。
"message": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [API, API, API]"
Run Code Online (Sandbox Code Playgroud)
我试过的:
任何帮助表示赞赏,谢谢!