我在我的 Angular 15 项目中使用 apollo-Angular 库。它在我的本地运行得很好,但是当我推送到我的 CI 时,它失败并出现以下错误:
Module not found: Error: Can't resolve '@apollo/client/core' in '/home/runner/work/my-frontend/my-frontend/node_modules/apollo-angular/fesm2022'
Did you mean 'index.js'?
BREAKING CHANGE: The request '@apollo/client/core' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
resolve '@apollo/client/core' in '/home/runner/work/my-frontend/my-frontend/node_modules/apollo-angular/fesm2022' ```
在一些非常特定的捆绑环境中,您可能需要指定
@apollo/client/core/index.js
而不是 @apollo/client/core
。
看来这是需要在
apollo-angular
中完成的更改,也许可以在 https://github.com/kamilkisiela/apollo-angular/issues/2172 中留下评论?