【发布时间】:2019-02-21 15:26:36
【问题描述】:
我正在尝试将 Nextjs 与 graphql-tag/loader 集成,这是我的 next.config.js 文件:
const withSass = require('@zeit/next-sass')
const graphqlLoader = require('graphql-tag/loader')
module.exports = withSass({
webpack: (config, { buildId, dev, isServer, defaultLoaders }) => {
config.module.rules.push({
test: /\.(graphql|gql)$/,
loader: graphqlLoader,
exclude: /node_modules/
})
return config
}
})
我无法构建,我收到以下错误:
/HOME/node_modules/graphql-tag/loader.js:43
this.cacheable();
^
TypeError: Cannot read property 'cacheable' of undefined
请帮忙。
【问题讨论】:
-
我尝试在
isServer === true时添加规则,在isServer === false时仍然无法构建,同样的错误。
标签: javascript webpack graphql next.js graphql-tag