Home > Software design >  I deployed my project, I am getting this error Input file contains unsupported image format
I deployed my project, I am getting this error Input file contains unsupported image format

Time:10-02

I am trying to build in my production environment (i using GitHub actions to do the deploy), but the wrong is what the node is not the same between in my local

in my local i have this version:

npm -v
-> 7.24.1

node -v
-> v14.13.1

but I don't know what is the node version on GitHub actions I can not reproduce the error in my local, because the version are not the same

I am getting this error:

success extract queries from components - 4.464s
success write out redirect data - 0.001s
success Build manifest and related icons - 0.003s
error "gatsby-plugin-manifest" threw an error while running the onPostBootstrap lifecycle:

Input file contains unsupported image format


  Error:Input file contains unsupported image format

not finished onPostBootstrap - 0.025s
npm ERR! code ELIFECYCLE

my proyect is implemented with gatsby this is the configuration:

module.exports = {
  siteMetadata: {
  plugins: [
    'gatsby-plugin-top-layout',
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'assets',
        path: `${__dirname}/src/assets`,
      },
    },
    'gatsby-transformer-sharp',
    'gatsby-plugin-sharp',
    {
      resolve: 'gatsby-plugin-manifest',
      options: {
        start_url: '/',
        background_color: '#493548',
        theme_color: '#493548',
        display: 'minimal-ui',
        icon: 'src/assets/dw-icon.png', // This path is relative to the root of the site.
      },
    },
    {
      resolve: 'gatsby-plugin-material-ui',
      options: {
        stylesProvider: {
          injectFirst: true,
        },
        // disableAutoprefixing: false,
        // disableMinification: false,
      },
    },
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-sitemap',
  ],
}

and these are my dependencies:

{
  "dependencies": {
    "@material-ui/core": "4.11.0",
    "@material-ui/icons": "4.9.1",
    "@material-ui/lab": "4.0.0-alpha.56",
    "@material-ui/styles": "4.11.4",
    "axios": "^0.21.0",
    "file-saver": "^2.0.5",
    "firebase": "^7.15.4",
    "gatsby": "^2.22.15",
    "gatsby-cli": "^2.12.87",
    "gatsby-image": "^2.4.5",
    "gatsby-plugin-manifest": "^2.4.9",
    "gatsby-plugin-material-ui": "3.0.0",
    "gatsby-plugin-react-helmet": "^3.3.2",
    "gatsby-plugin-react-redux": "1.1.0",
    "gatsby-plugin-react-svg": "^3.0.0",
    "gatsby-plugin-robots-txt": "^1.6.8",
    "gatsby-plugin-sharp": "^2.6.9",
    "gatsby-plugin-sitemap": "3.3.0",
    "gatsby-source-filesystem": "^2.3.8",
    "gatsby-transformer-sharp": "2.5.3",
    "material-ui-dropzone": "3.3.0",
    "npm": "^7.5.6",
    "prop-types": "^15.7.2",
    "react": "^16.13.1",
    "react-redux": "^7.2.1",
    "redux": "^4.0.5",
    "redux-mock-store": "^1.5.4",
    "stopword": "^1.0.3",
    "tracking-number-validation": "^2.0.2",
    "uuid": "^8.3.2"
  },
}

this is the build.yml to deploy to production

name: Build

on:
  push:
    branches:
      - master

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2
  deploy:
    name: Deploy
    needs: build
    runs-on: ubuntu-latest
    steps:
      - run: echo ${{ github.ref }}
      - name: Checkout Repo
        uses: actions/checkout@v2
      

CodePudding user response:

but i dont know what is the node version on github actions i can not reproduce the error in my local, because of the version are not the same

You could use setup-node action to make the version exactly same with your local:

- uses: actions/setup-node@v2
  with:
    node-version: '14.13.1'
- run: npm install -g [email protected]
- run: npm -v
- run: node -v

The output in github:

Run npm -v
  npm -v
  shell: /usr/bin/bash -e {0}
7.24.1
Run node -v
  node -v
  shell: /usr/bin/bash -e {0}
v14.13.1
  • Related