在react框架使用apollo报错
import {
ApolloClient,
InMemoryCache,
ApolloProvider,
useQuery,
gql
} from "@apollo/client";
./node_modules/graphql/utilities/extendSchema.mjs
Module parse failed: Unexpected token (150:4)
You may need an appropriate loader to handle this file type.
| schemaConfig.subscription && replaceNamedType(schemaConfig.subscription),
| // Then, incorporate schema definition and all schema extensions.
| ...(schemaDef && getOperationTypes([schemaDef])),
| ...getOperationTypes(schemaExtensions),
| }; // Then produce and return a Schema config with these types.
不报错
文件解析错误,看看是否文件后缀错误,或者少装了什么loader
You may need an appropriate loader to handle this file type.
根据这个 应该是你加了 什么文件 吧 需要特定 loader 解析 。