首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在GitHub Actions CI中运行时,Gatsby引发SIGSEV错误

在GitHub Actions CI中运行时,Gatsby引发SIGSEV错误
EN

Stack Overflow用户
提问于 2020-01-10 18:13:35
回答 1查看 995关注 0票数 6

我在my Gatsby site上运行gatsby build时遇到了问题,只有在Github Actions容器中运行时才会发生这种问题。这也不总是发生;作为一个很好的例子,今天Dependabot启动了12个PR,其中两个失败了,出现了这个错误。错误显示如下:

代码语言:javascript
复制
$ gatsby build
╔════════════════════════════════════════════════════════════════════════╗
║                                                                        ║
║   Gatsby collects anonymous usage analytics                            ║
║   to help improve Gatsby for all users.                                ║
║                                                                        ║
║   If you'd like to opt-out, you can use `gatsby telemetry --disable`   ║
║   To learn more, checkout https://gatsby.dev/telemetry                 ║
║                                                                        ║
╚════════════════════════════════════════════════════════════════════════╝
success open and validate gatsby-configs - 0.035s
success load plugins - 0.892s
success onPreInit - 0.010s
success delete html and css files from previous builds - 0.015s
success initialize cache - 0.013s
success copy gatsby files - 0.029s
warn gatsby-plugin-feed was initialized in gatsby-config.js without a feeds option.
This means that the plugin will use the internal RSS feed creation, which may not match your use
case.
This behavior will be removed in the next major release of gatsby-plugin-feed.
success onPreBootstrap - 0.014s
success createSchemaCustomization - 0.149s
success source and transform nodes - 0.193s
⠀
info bootstrap finished - 5.713 s
⠀
success Building production JavaScript and CSS bundles - 19.548s
success Rewriting compilation hashes - 0.002s
success run queries - 21.003s - 10/10 0.48/s
error Command failed with signal "SIGSEGV".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Docker run failed with exit code 1

正如您所看到的,没有太多信息,只有一行描述了错误:error Command failed with signal "SIGSEGV"。我一直在寻找一种方法来使Gatsby的输出更详细,但是在build命令中似乎没有详细选项。

我唯一的线索是,它可能与处理Gatsby-Sharp和Gatsby-Image中的图像有关,由于this thread on the Gatsby GitHub repo,这两个存储库都使用了这两个工具。但似乎该主题中的许多人都报告了不同的问题,这些问题只有切线上的相似之处;很难找出可能相关的问题。

gatsby-config.js

代码语言:javascript
复制
module.exports = {
  siteMetadata: {
    title: `Matt.si`,
    description: `Mattsi Jansky's personal programming/tech blog`,
    author: `Mattsi Jansky`,
    siteUrl: `http://www.matt.si`,
    social: {
      twitter: `mattsijansky`,
      facebook: ``,
      github: `mattsi-jansky`,
      linkedin: `mjjansky`,
      email: `mattsi@jansky.dev`,
    },
  },
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/content/blog`,
        name: `blog`,
      },
    },
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: `gatsby-remark-images`,
            options: {
              maxWidth: 970,
              showCaptions: true
            },
          },
          `gatsby-remark-prismjs`,
        ],
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-google-analytics`,
      options: {
        trackingId: `UA-54448080-1`,
      },
    },
    `gatsby-plugin-feed`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `Matt.si`,
        short_name: `mattsi`,
        start_url: `/`,
        background_color: `#663399`,
        theme_color: `#663399`,
        display: `minimal-ui`,
        icon: `./static/favicon.png`, // This path is relative to the root of the site.
      },
    },
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: `gatsby-remark-footnotes`,
            options: {
              footnoteBackRefPreviousElementDisplay: "inline",
              footnoteBackRefDisplay: "inline",
              footnoteBackRefInnerText: "^",
              footnoteBackRefAnchorStyle: `text-decoration: none;`,
              footnoteBackRefInnerTextStartPosition: "front",
            }
          }
        ]
      }
    },
    // `gatsby-plugin-offline`,
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-sass`,
  ],
}

Package.json

代码语言:javascript
复制
{
  "name": "matt.si",
  "private": false,
  "description": "Mattsi Jansky's personal blog",
  "author": "Mattsi Jansky",
  "scripts": {
    "build": "gatsby build",
    "dev": "gatsby develop",
    "test": "jest",
    "test:updateSnapshots": "jest --updateSnapshot",
    "test:visual": "yarn build && ./scripts/run-visual-regression-tests.sh",
    "test:visual:update": "docker-compose run visual-regression-tests reference",
    "test:visual:approve": "docker-compose run visual-regression-tests approve",
    "lint": "eslint --ext .js,.jsx --ignore-pattern public .",
    "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js' 'src/**/*.md'"
  },
  "dependencies": {
    "babel-preset-gatsby": "0.2.26",
    "gatsby": "2.18.21",
    "gatsby-image": "2.2.37",
    "gatsby-plugin-feed": "2.3.25",
    "gatsby-plugin-google-analytics": "2.1.31",
    "gatsby-plugin-manifest": "2.2.34",
    "gatsby-plugin-offline": "3.0.30",
    "gatsby-plugin-react-helmet": "3.1.18",
    "gatsby-plugin-sass": "2.1.26",
    "gatsby-plugin-sharp": "2.3.10",
    "gatsby-remark-footnotes": "0.0.7",
    "gatsby-remark-images": "3.1.39",
    "gatsby-remark-prismjs": "3.3.28",
    "gatsby-source-filesystem": "2.1.43",
    "gatsby-transformer-remark": "2.6.45",
    "gatsby-transformer-sharp": "2.3.9",
    "identity-obj-proxy": "3.0.0",
    "node-sass": "4.13.0",
    "prismjs": "1.18.0",
    "prop-types": "15.7.2",
    "react": "16.12.0",
    "react-dom": "16.12.0",
    "react-helmet": "5.2.1",
    "react-test-renderer": "16.12.0",
    "rehype-react": "4.0.1"
  },
  "devDependencies": {
    "babel-jest": "24.9.0",
    "enzyme": "3.11.0",
    "enzyme-adapter-react-16": "1.15.2",
    "eslint": "6.8.0",
    "eslint-plugin-react": "7.17.0",
    "jest": "24.9.0",
    "prettier": "1.19.1",
    "wait-on": "3.3.0"
  },
  "license": "GPL-3.0-only"
}

我不确定还有什么可能会有帮助,但在repo中所有的东西都是公开的。我正尝试在CI服务器上运行gatsby info,但在运行时遇到了一些问题。有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-17 18:38:48

将所有gatsby插件更新为最新版本,并遵循此source

这对我很有效,?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59679622

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档