【发布时间】:2022-01-17 03:15:04
【问题描述】:
安装新版本的 apollo 客户端后出现此错误。我尝试了其他版本并降级但没有。我还尝试在 metro.config.js 中指定解析“cjs”类型的文件(@apollo/client/main.cjs),但没有。
错误
error: Error: While trying to resolve module `@apollo/client` from file `****\src\api\queries\home.js`, the package `****\node_modules\@apollo\client\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`****\node_modules\@apollo\client\main.cjs`. Indeed, none of these files exist:
依赖关系
"@apollo/client": "^3.3.2",
"graphql": "^15.4.0",
有人可以帮帮我吗?将不胜感激!
【问题讨论】:
标签: react-native graphql bundle apollo-client