【发布时间】:2023-02-02 16:32:38
【问题描述】:
成功更新到 Angular 14 后,我们的 e2e cypress (v9) 测试无法编译。失败是由导入在 Angular 更新之前工作的内容引起的。
似乎 webpack 在错误的目录中查找,因为“node_modules”位于项目根目录下 (D:\git\template\projects\node_modules),请参见下文。为什么会出现问题,如何解决?
[1] Error: Webpack Compilation Error
[1] ./projects/e2e/integration/demo.spec.ts
[1] Module not found: Error: Can't resolve '@shift/simulator-plugins/plugins/simulatorplugin/simulatorplugin' in 'D:\git\template\projects\e2e\integration'
[1] resolve '@shift/simulator-plugins/plugins/simulatorplugin/simulatorplugin' in 'D:\git\template\projects\e2e\integration'
[1] Parsed request is a module
[1] using description file: D:\git\template\package.json (relative path: ./projects/e2e/integration)
[1] Field 'browser' doesn't contain a valid alias configuration
[1] Looked for and couldn't find the file at the following paths:
[1] [D:\git\template\projects\e2e\integration\node_modules]
[1] [D:\git\template\projects\e2e\node_modules]
[1] [D:\git\template\projects\node_modules]
[1] [D:\node_modules]
【问题讨论】:
标签: angular typescript webpack cypress e2e-testing