盖茨比在Netlify上构建失败。警告:在处理程序中创建了一个Promise

时间:2018-12-10 14:51:54

标签: reactjs gatsby postcss contentful netlify

在Netlify上生成错误。生成超出了允许的最大运行时间。 可以在本地运行的yarn build和Netlify docker容器内部构建,但是在Netlifys构建时,它超出了允许的最大运行时间。

在Netlify docker容器中运行时会收到类似以下的警告 Warning: a promise was created in a handler at opt/buildhome/repo/node_modules/postcss/lib/lazy-result.js:213:17 but was not returned from it

Warning: a promise was created in a handler at /opt/buildhome/repo/node_modules/gatsby-transformer-remark/extend-node-type.js:179:19 but was not returned from it

这两个警告指向我配置的两个Gatsby插件。 (在下面配置)

require('dotenv').config();

module.exports = {
  siteMetadata: {
    title: 'My Website',
  },
  proxy: {
    prefix: '/.netlify/functions',
    url: 'http://localhost:9000',
  },
  plugins: [
    'gatsby-plugin-eslint',
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-postcss',
    {
      resolve: 'gatsby-source-contentful',
      options: {
        spaceId: process.env.SPACE_ID,
        accessToken: process.env.ACCESS_TOKEN,
      },
    },
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        rule: {
          exclude: /img/,
        },
      },
    },
    'gatsby-plugin-sharp',
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-images-contentful',
            options: {
              maxWidth: 590,
            },
          },
        ],
      },
    },
    'gatsby-plugin-netlify', // make sure to keep it last in the array
  ],
};

已经尝试在整个周末进行调试,但不确定要做什么。我找不到其他遇到过类似问题的人。

0 个答案:

没有答案