首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >[Bug]:在版本更新后无法找到模块@ngrx/effects/testing

[Bug]:在版本更新后无法找到模块@ngrx/effects/testing
EN

Stack Overflow用户
提问于 2021-12-02 10:25:28
回答 1查看 973关注 0票数 2

我将项目从25版迁移到了27版,模块‘@ngrx/effects/ the’再也找不到了。在我的例子中,项目中的baseUrl设置为‘./src’,在其他带有baseUrl‘的项目中。和相同的玩笑,角度,ngrx测试运行没有问题。也许还需要额外的配置来取笑?

这是我得到的信息:

Cannot find module '@ngrx/store/testing' from 'src/app/app.component.spec.ts'.

来自package.json的一些依赖项:

代码语言:javascript
运行
复制
"dependencies": {
    "@angular/animations": "13.0.2",
    "@angular/common": "13.0.2",
    "@angular/core": "13.0.2",
    "@angular/forms": "13.0.2",
    "@angular/localize": "^13.0.2",
    "@angular/platform-browser": "13.0.2",
        ...
    "@ngrx/effects": "13.0.1",
    "@ngrx/entity": "13.0.1",
    "@ngrx/store": "13.0.1",
}
"devDependencies": {
 "@types/jest": "27.0.3",
   "jest": "^27.4.3",
    "jest-junit": "13.0.0",
    "jest-marbles": "3.0.1",
    "jest-preset-angular": "^11.0.1",
      ...
}

BaseUrl设置为tsconfig.json中的"./src“。

代码语言:javascript
运行
复制
{
  "compileOnSave": false,
  "compilerOptions": {
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "baseUrl": "./src",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "module": "es2020",
    "esModuleInterop": true,
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

下面是jest配置:

代码语言:javascript
运行
复制
"jest": {
    "preset": "jest-preset-angular",
    "setupFilesAfterEnv": [
      "<rootDir>/setupJest.ts"
    ],
    "moduleDirectories": [
      "node_modules",
      "src"
    ]
  }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-02 13:26:02

更新:此错误已在13.0.2版中解决。

这是一个已知的问题,并且已经在https://github.com/ngrx/platform/issues/3248中解决了,它将包含在ngrx的下一个版本中。

在此之前,您可以安装一个夜间版本,https://ngrx.io/guide/nightlies

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70197743

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档