A build plugin to integrate Gatsby seamlessly with Netlify

Overview

Netlify Build plugin Gatsby – Run Gatsby seamlessly on Netlify

Essential Gatsby Plugin

This build plugin is a utility for supporting Gatsby on Netlify. To support build caching and Gatsby functions on Netlify, you will need to install this plugin for your app.

Note:

Table of Contents

Installation and Configuration

Manual Installation

  1. Create a netlify.toml in the root of your project. Your file should include the plugins section below:
[build]
command = "npm run build"
publish = "public/"

[[plugins]]
package = "@netlify/plugin-gatsby"
  1. From your project's base directory, add this plugin to devDependencies in package.json.
# yarn add -D @netlify/plugin-gatsby
npm install -D @netlify/plugin-gatsby

Read more about file-based plugin installation in our docs.

CLI Usage

If you'd like to build and deploy your project using the Netlify CLI, we recommend this workflow to manage git tracking plugin-generated files:

  1. Make sure all your project's files are committed before running a build with the CLI
  2. Run any number of builds and deploys freely (i.e. netlify build, netlify deploy --build, netlify deploy --prod)
  3. Run git stash --include-unstaged to easily ignore plugin-generated files

It's important to note that the CLI may mix your project's source code and plugin-generated files; this is why we recommend committing all project source files before running CLI builds.

Using Gatsby Functions

This plugin will convert all Gatsby Functions in the project to run as Netlify functions. This should be invisible: you can write the Gatsby Functions in the same way as you usually would. The API is the same, and if you use this plugin then it will deploy to Netlify functions without needing any extra configuration.

When the site is built, this plugin will create a wrapper Netlify function in /netlify/functions/gatsby, and then deploy that alongside the Gatsby functions. If you run this locally with the Netlify CLI, you will see it create these files. It will add an entry to your .gitignore to ignore the /netlify/functions/gatsby directory.

Local development

When developing Gatsby Functions it is usually easier to use the built-in gatsby develop functions server. However if you want to try the Netlify functions wrapper it will run via netlify dev. However you should be sure to run netlify build first, so that the wrappers are generated and the functions copied across.

Comments
  • Intermittent Build Failures at Merge Worker State

    Intermittent Build Failures at Merge Worker State

    Describe the bug

    Beginning when I upgraded to Gatsby v4.6 I started getting errors when building on Netlify. Most builds succeed, and then all of a sudden all builds fail. Sometimes clearing the cache fixes it, sometimes not. Now, a content change caused my production deploy to fail twice in a row.

    I read that this might have been a regression, so I downgraded to 4.5, which fixed it initially but now build failures are happening again.

    Steps to reproduce

    Build gatsby site on netlify with v4.5 or v4.6

    Expected behavior

    A successful build.

    Configuration

    module.exports = { flags: { // FAST_DEV: true, PRESERVE_FILE_DOWNLOAD_CACHE: true, PARALLEL_SOURCING: true, }, plugins: [ gatsby-plugin-react-helmet, gatsby-plugin-extract-schema, // { // resolve: gatsby-plugin-sharp, // options: { defaults: { placeholder: 'none', quality: 90 } }, // }, // babel-plugin-remove-graphql-queries, // for use with storybook gatsby-plugin-advanced-sitemap, // gatsby-plugin-webpack-bundle-analyser-v3, // gatsby-plugin-preload-link-crossorigin,

    // `gatsby-plugin-lint-queries`,
    `gatsby-plugin-sharp`,
    `babel-plugin-remove-graphql-queries`,
    {
      resolve: `gatsby-plugin-feed`,
      options: {
        query: `
        {site {
          siteMetadata {
            title
            description
            siteUrl
            site_url: siteUrl
          }
        }}`,
        feeds: [
          {
            serialize: ({ query: { blog, site } }) => {
              return blog.nodes.map(
                ({ title, date, slug, body, category, author }) => ({
                  title: title,
                  description: body.childMarkdownRemark.excerpt,
                  categories: [category],
                  author: author,
                  date: date,
                  url: site.siteMetadata.siteUrl + '/blog/' + slug,
                  guid: site.siteMetadata.siteUrl + '/blog/' + slug,
                })
              )
            },
            query: `
            {
        blog: allContentfulBlogPost(sort: { fields: [date], order: DESC }) {
          nodes {
            title
            category
            author{
              name
            }
            date
            slug
            body {
              childMarkdownRemark {
                excerpt
              }
            }
          }
        }
      }
        `,
            output: '/rss.xml',
            title: 'Blog RSS',
          },
        ],
      },
    },
    {
      resolve: `gatsby-theme-material-ui`,
      options: {
        webFontsConfig: null,
      },
    },
    {
      resolve: `gatsby-plugin-anchor-links`,
      options: {
        offset: -150,
      },
    },
    {
      resolve: 'gatsby-plugin-robots-txt',
      options: {
        sitemap: `${siteUrl}/sitemap/sitemap-pages.xml`,
        resolveEnv: () => CONTEXT,
        env: {
          production: {
            policy: [{ userAgent: '*' }],
          },
          'branch-deploy': {
            policy: [
              { userAgent: '*', disallow: ['/'] },
              { userAgent: 'Algolia Crawler', allow: ['/'] },
            ],
          },
          'deploy-preview': {
            policy: [
              { userAgent: '*', disallow: ['/'] },
              {
                userAgent: 'Algolia Crawler',
                allow: ['/ # Algolia-Crawler-Verif: STRING'],
              },
            ],
          },
        },
      },
    },
    {
      resolve: 'gatsby-plugin-intercom-spa',
      options: {
        app_id: GATSBY_INTERCOM_APP_ID,
        include_in_development: true,
        delay_timeout: 5000,
      },
    },
    {
      resolve: `gatsby-plugin-canonical-urls`,
      options: {
        siteUrl,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `air_docs`,
        path: `${__dirname}/docs/`,
      },
    },
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        rule: {
          include: /assets\/svg/,
        },
      },
    },
    {
      resolve: `gatsby-transformer-sharp`,
    },
    {
      resolve: `gatsby-transformer-inline-svg`,
    },
    {
      resolve: `gatsby-plugin-image`,
    },
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
         // Details removed for privacy
        cache_busting_mode: 'none',
        crossOrigin: 'anonymous',
      },
    },
    
    // this (optional) plugin enables Progressive Web App + Offline functionality
    // To learn more, visit: https://gatsby.dev/offline
    {
      resolve: `gatsby-plugin-offline`,
    },
    // `gatsby-plugin-force-trailing-slashes`,
    {
      resolve: 'gatsby-source-contentful',
      options: {
        spaceId: CONTENTFUL_SPACE_ID,
        accessToken: ACCESS_TOKEN,
      },
    },
    {
      resolve: 'gatsby-source-contentful',
      options: {
        spaceId: AIR_CONTENTFUL_SPACE_ID,
        accessToken: AIR_ACCESS_TOKEN,
      },
    },
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: `gatsby-remark-embed-video`,
            options: {
              width: 560,
              height: 315,
              related: false,
              noIframeBorder: true,
            },
          },
          {
            resolve: `gatsby-remark-responsive-iframe`,
          },
          {
            resolve: `gatsby-remark-images-contentful`,
            options: {
              maxWidth: 800,
              withWebp: true,
              linkImagesToOriginal: false,
              sizeByPixelDensity: true,
            },
          },
          {
            resolve: `gatsby-remark-autolink-headers`,
            options: {
              icon: `<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="18" cy="18" r="18" fill="white"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M16 23C16 23.6 15.6 24 15 24H12C8.7 24 6 21.3 6 18C6 14.7 8.7 12 12 12H15C15.6 12 16 12.4 16 13C16 13.6 15.6 14 15 14H12C9.8 14 8 15.8 8 18C8 20.2 9.8 22 12 22H15C15.6 22 16 22.4 16 23ZM24 12H21C20.4 12 20 12.4 20 13C20 13.6 20.4 14 21 14H24C26.2 14 28 15.8 28 18C28 20.2 26.2 22 24 22H21C20.4 22 20 22.4 20 23C20 23.6 20.4 24 21 24H24C27.3 24 30 21.3 30 18C30 14.7 27.3 12 24 12ZM14 19C13.4 19 13 18.6 13 18C13 17.4 13.4 17 14 17H22C22.6 17 23 17.4 23 18C23 18.6 22.6 19 22 19H14Z" fill="#363E50"/> </svg>`,
              isIconAfterHeader: true,
              enableCustomId: true,
              elements: ['h1', 'h2', 'h3'],
              offsetY: 100,
            },
          },
          `gatsby-remark-prismjs`,
        ],
      },
    },
    {
      resolve: 'gatsby-plugin-preconnect',
      options: {
        domains: [
          'https://www.google.com',
          'https://googleads.g.doubleclick.net',
          'https://www.google-analytics.com',
          'https://www.googleadservices.com',
          'https://www.googletagmanager.com',
        ],
      },
    },
    {
      resolve: `gatsby-plugin-gdpr-cookies`,
      options: {
        googleTagManager: {
          trackingId: TAG_MANAGER_ID,
          cookieName: 'gatsby-gdpr-google-tagmanager',
          defaultDataLayer: { platform: 'gatsby' },
        },
        // only turn on when debugging
        // environments: ['production', 'development'],
      },
    },
    {
      resolve: `gatsby-plugin-algolia`,
      options: {
        enablePartialUpdates: true,
        appId: process.env.GATSBY_ALGOLIA_APP_ID,
        apiKey: process.env.ALGOLIA_ADMIN_KEY,
        queries,
        chunkSize: 10000, // default: 1000
      },
    },
    {
      resolve: `gatsby-plugin-netlify`,
      options: {
        headers: {
          '/**/*.html': [
            'cache-control: public',
            'cache-control: max-age=0',
            'cache-control: must-revalidate',
          ],
          '/page-data/*.json': [
            'cache-control: public',
            'cache-control: max-age=0',
            'cache-control: must-revalidate',
          ],
          '/app-data.json': [
            'cache-control: public',
            'cache-control: max-age=0',
            'cache-control: must-revalidate',
          ],
          '/static/*': [
            'cache-control: public',
            'cache-control: max-age=31536000',
            'cache-control: immutable',
          ],
          '/**/*.js': [
            'cache-control: public',
            'cache-control: max-age=3156000',
            'cache-control: immutable',
          ],
          '/**/*.css': [
            'cache-control: public',
            'cache-control: max-age=3156000',
            'cache-control: immutable',
          ],
          '/sw.js': [
            'cache-control: public',
            'cache-control: max-age=0',
            'cache-control: must-revalidate',
          ],
        },
      },
    },       
    

    Environment

    Enter the following command in a terminal and copy/paste its output:

    npx envinfo --system --binaries --browsers --npmPackages @netlify/plugin-gatsby
    

    Screenshots

    image

    Can you submit a pull request?

    No (don't know what the problem is)

    Pull requests are welcome! If you would like to help us fix this bug, please check our contributions guidelines.

    bug 
    opened by panzacoder 28
  • Failure to deploy when importing dotenv using ESM syntax

    Failure to deploy when importing dotenv using ESM syntax

    Describe the bug

    My site deployed fine when using the old, now deprecated, Gatsby cache Netlify plugin. I uninstalled this plugin and installed the essential gatsby plugin but my build no longer succeeds.

    I suspect it is because I am using ES Modules instead of CommonJS. I am importing dotenv in my gatsby-config.js file and when building, I receive the following error:

    Plugin "@netlify/plugin-gatsby" failed

    /opt/build/repo/gatsby-config.js:1 import dotenv from 'dotenv'; ^^^^^^

    SyntaxError: Cannot use import statement outside a module

    In "onPreBuild" event in "@netlify/plugin-gatsby" from Netlify app at loadGatsbyFile (/.netlify/plugins/node_modules/@netlify/plugin-gatsby/src/index.js:32:12) at onPreBuild (/.netlify/plugins/node_modules/@netlify/plugin-gatsby/src/index.js:57:26)

    Steps to reproduce

    Step-by-step instructions on how to reproduce the behavior.

    Example:

    1. In your Gatsby site, update your package.json start script to be "start": "NODE_OPTIONS='-r esm' gatsby develop"
    2. Install dotenv and add an import statement for it to the top of you gatsby-config.js file import dotenv from 'dotenv';

    Expected behavior

    The build should complete without issue but fails as it cannot import dotenv.

    Can you submit a pull request?

    No.

    Pull requests are welcome! If you would like to help us fix this bug, please check our contributions guidelines.

    bug 
    opened by Sephster 14
  • chore: update linting

    chore: update linting

    πŸŽ‰ Thanks for sending this pull request! πŸŽ‰

    Please make sure the title is clear and descriptive.

    If you are fixing a typo or documentation, please skip these instructions.

    Otherwise please fill in the sections below.

    Which problem is this pull request solving?

    Example: I'm always frustrated when [...]

    List other issues or pull requests related to this problem

    Example: This fixes #5012

    Describe the solution you've chosen

    Example: I've fixed this by [...]

    Describe alternatives you've considered

    Example: Another solution would be [...]

    Checklist

    Please add a x inside each checkbox:

    • [ ] I have read the contribution guidelines.
    • [ ] I have added tests (we are enforcing 100% test coverage).
    • [ ] I have added documentation in the README.md, the docs directory (if any) and the examples directory (if any).
    • [ ] The status checks are successful (continuous integration). Those can be seen below.
    type: chore automerge 
    opened by XhmikosR 13
  • Error

    Error "Module did not self-register" in SSR pages after upgrading to 4.8.0

    Yes the site does build however SSR stopped working and I thought maybe this was related.

    Now, I'm getting this message when I visit a page with SSR.

    {
    "errorType": "Error",
    "errorMessage": "Module did not self-register: '/var/task/.cache/query-engine/assets/prebuilds/linux-x64/node.abi93.glibc.node'.",
    "trace": [
    "Error: Module did not self-register: '/var/task/.cache/query-engine/assets/prebuilds/linux-x64/node.abi93.glibc.node'.",
    "    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)",
    "    at Module.load (internal/modules/cjs/loader.js:950:32)",
    "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
    "    at Module.require (internal/modules/cjs/loader.js:974:19)",
    "    at require (internal/modules/cjs/helpers.js:93:18)",
    "    at Object.exports.__esModule (/var/task/.cache/query-engine/index.js:146728:18)",
    "    at __webpack_require__ (/var/task/.cache/query-engine/index.js:682628:42)",
    "    at Object.<anonymous> (/var/task/.cache/query-engine/index.js:146682:20)",
    "    at __webpack_require__ (/var/task/.cache/query-engine/index.js:682628:42)",
    "    at Object.defineProperty.value (/var/task/.cache/query-engine/index.js:144176:13)"
    ]
    }
    

    It was working before upgrading Gatsby to v4.8 and it works locally.

    Originally posted by @t2ca in https://github.com/netlify/netlify-plugin-gatsby/issues/291#issuecomment-1049005132

    status: needs reproduction 
    opened by ascorbic 12
  • Could not import plugin (v 2.1.1 on netlify.app)

    Could not import plugin (v 2.1.1 on netlify.app)

    Thanks for reporting this bug!

    If this is related to a typo or the documentation being unclear, please click on the relevant page's Edit button (pencil icon) and suggest a correction instead.

    Please search other issues to make sure this bug has not already been reported.

    Then fill in the sections below.

    Describe the bug

    I was deploying some updates for a project using gatsby's default wordpress starter. The last successful deploy was on march 1st

    Steps to reproduce

    I really don't know how to reproduce this one! Even the failed builds (not related to the plugin) got past the loading of the plugin and even retrieved data from my source.

    Expected behavior

    Plugin should load.

    Configuration

    Command line options and/or configuration file, if any.

    Environment

    Enter the following command in a terminal and copy/paste its output:

    npx envinfo --system --binaries --browsers --npmPackages @netlify/plugin-gatsby
    

    this is from the Netlify output image

    Screenshots image

    Can you submit a pull request?

    No.

    bug 
    opened by eightshone 11
  • Could not find a binding for Linux 64-bit with Node.js 12.x

    Could not find a binding for Linux 64-bit with Node.js 12.x

    Describe the bug

    I'm receiving the following error in my builds after installing gatsby-plugin-netlify instead of the old gatsby cache plugin. I've tried Clear cache and deploy site and rebuilding my lock file.

    Previouly, node 15 has worked well but something is happening with my node-sass package combined with this plugin. I also have my gastby-config in a ts file that has been transpiling to JS during the build, which might also be connected here.

    Is there anything I could do to inspect this error? I'm not sure how to debug this since it's in the onPreBuild phase.

    Plugin "@netlify/plugin-gatsby" failed
    
    Error: Could not load gatsby-config.js
    Missing binding /opt/build/repo/node_modules/node-sass/vendor/linux-x64-72/binding.node
    Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x
    
    Found bindings for the following environments:
    
    Linux 64-bit with Node.js 15.x
    
    This usually happens because your environment has changed since running npm install.
    Run npm rebuild node-sass to download the binding for your current environment.
    

    (Previously reported in https://github.com/netlify/gatsby-plugin-netlify/issues/28.)

    Steps to reproduce

    My project is open-source, so you can see a failed build with the following:

    • Repo: https://github.com/emarchak/randonneurs-to
    • PR with failed build: https://github.com/emarchak/randonneurs-to/pull/204
    • Failed build: https://app.netlify.com/sites/randonneursto/deploys/616cc583cb0711c3b30ed394

    Expected behavior

    Builds are successful. 🀣

    Configuration

    It was installed via the UI. My netlify build script is set to npm run build:production, which maps to gatsby build

    Environment

    I'm not sure how to run the npx command since this is on the onPreBuild phase. If there's a good way, please let me know. I have my full build log here, I hope that it helps!

    Full log from a failed build
    6:36:50 PM: Build ready to start
    6:36:53 PM: build-image version: dd2f6d8803393d46ac35a4f752a5a46f254c0300
    6:36:53 PM: build-image tag: v3.9.1
    6:36:53 PM: buildbot version: 349bc0ff8daba7d6ea8d12b21f2f782cbf97d24f
    6:36:53 PM: Fetching cached dependencies
    6:36:53 PM: Starting to download cache of 965.5MB
    6:37:01 PM: Finished downloading cache in 8.007225114s
    6:37:01 PM: Starting to extract cache
    6:37:41 PM: Finished extracting cache in 40.008764065s
    6:37:41 PM: Finished fetching cache in 48.276314496s
    6:37:41 PM: Starting to prepare the repo for build
    6:37:41 PM: Preparing Git Reference pull/204/head
    6:37:43 PM: Parsing package.json dependencies
    6:37:44 PM: Starting build script
    6:37:44 PM: Installing dependencies
    6:37:44 PM: Python version set to 2.7
    6:37:45 PM: Started restoring cached node version
    6:37:48 PM: Finished restoring cached node version
    6:37:48 PM: Attempting node version '15.14.0' from .nvmrc
    6:37:49 PM: v15.14.0 is already installed.
    6:37:50 PM: Now using node v15.14.0 (npm v7.7.6)
    6:37:50 PM: Started restoring cached build plugins
    6:37:50 PM: Finished restoring cached build plugins
    6:37:50 PM: Attempting ruby version 2.6.2, read from environment
    6:37:52 PM: Using ruby version 2.6.2
    6:37:52 PM: Using PHP version 5.6
    6:37:52 PM: Started restoring cached yarn cache
    6:38:07 PM: Finished restoring cached yarn cache
    6:38:07 PM: No yarn workspaces detected
    6:38:07 PM: Started restoring cached node modules
    6:38:07 PM: Finished restoring cached node modules
    6:38:08 PM: Installing NPM modules using Yarn version 1.17.0
    6:38:08 PM: yarn install v1.17.0
    6:38:09 PM: [1/4] Resolving packages...
    6:38:10 PM: [2/4] Fetching packages...
    6:38:42 PM: info [email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The CPU architecture "x64" is incompatible with this module.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: info @netlify/[email protected]: The platform "linux" is incompatible with this module.
    6:38:42 PM: info "@netlify/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    6:38:42 PM: [3/4] Linking dependencies...
    6:38:42 PM: warning "@apollo/react-hooks > @apollo/[email protected]" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "@apollo/react-hooks > @apollo/client > @graphql-typed-document-node/[email protected]" has unmet peer dependency "graphql@^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > [email protected]" has unmet peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning " > @bugsnag/[email protected]" has unmet peer dependency "@bugsnag/core@^7.0.0".
    6:38:42 PM: warning " > @jagi/[email protected]" has unmet peer dependency "graphql-tag@^2.10.0".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > [email protected]" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > apollo-cache > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "apollo-boost > apollo-link-error > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "@babel/core@^7.11.6".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "core-js@^3.0.0".
    6:38:42 PM: warning "gatsby > [email protected]" has unmet peer dependency "babel-eslint@^10.0.0".
    6:38:42 PM: warning "gatsby > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
    6:38:42 PM: warning "gatsby-source-graphql > @graphql-tools/[email protected]" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "gatsby > eslint-plugin-graphql > graphql-config > @endemolshinegroup/cosmiconfig-typescript-loader > [email protected]" has unmet peer dependency "typescript@>=2.7".
    6:38:42 PM: warning "gatsby-source-graphql > @graphql-tools/links > @graphql-tools/[email protected]" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "gatsby-source-graphql > @graphql-tools/[email protected]" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "@babel/core@^7.12.3".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "sass@^1.30.0".
    6:38:42 PM: warning "gatsby-plugin-sass > [email protected]" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
    6:38:42 PM: warning "gatsby-source-graphql > @graphql-tools/[email protected]" has unmet peer dependency "@apollo/client@~3.2.5 || ~3.3.0".
    6:38:42 PM: warning "gatsby-source-graphql > @graphql-tools/[email protected]" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
    6:38:42 PM: warning "gatsby-source-graphql > @graphql-tools/links > [email protected]" has unmet peer dependency "graphql@14 - 15".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "@babel/core@^7.8.0".
    6:38:42 PM: warning "babel-jest > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
    6:38:42 PM: warning "babel-jest > babel-preset-jest > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
    6:38:42 PM: warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
    6:38:42 PM: warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
    6:38:42 PM: warning " > [email protected]" has unmet peer dependency "eslint-plugin-import@>=1.4.0".
    6:39:04 PM: [4/4] Building fresh packages...
    6:39:18 PM: Done in 69.33s.
    6:39:18 PM: NPM modules installed using Yarn
    6:39:18 PM: Started restoring cached go cache
    6:39:20 PM: Finished restoring cached go cache
    6:39:20 PM: Installing Go version 1.12
    6:39:20 PM: unset GOOS;
    6:39:20 PM: unset GOARCH;
    6:39:20 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
    6:39:20 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
    6:39:20 PM: go version >&2;
    6:39:20 PM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
    6:39:20 PM: go version go1.12 linux/amd64
    6:39:20 PM: Installing missing commands
    6:39:20 PM: Verify run directory
    6:39:22 PM: ​
    6:39:22 PM: ────────────────────────────────────────────────────────────────
    6:39:22 PM:   Netlify Build                                                 
    6:39:22 PM: ────────────────────────────────────────────────────────────────
    6:39:22 PM: ​
    6:39:22 PM: ❯ Version
    6:39:22 PM:   @netlify/build 18.17.2
    6:39:22 PM: ​
    6:39:22 PM: ❯ Flags
    6:39:22 PM:   baseRelDir: true
    6:39:22 PM:   buildId: 616ca582432ee70007ec7531
    6:39:22 PM:   deployId: 616ca582432ee70007ec7533
    6:39:22 PM: ​
    6:39:22 PM: ❯ Current directory
    6:39:22 PM:   /opt/build/repo
    6:39:22 PM: ​
    6:39:22 PM: ❯ Config file
    6:39:22 PM:   /opt/build/repo/netlify.toml
    6:39:22 PM: ​
    6:39:22 PM: ❯ Context
    6:39:22 PM:   deploy-preview
    6:39:23 PM: ​
    6:39:23 PM: ❯ Installing plugins
    6:39:23 PM:    - @netlify/[email protected]
    6:39:32 PM: ​
    6:39:32 PM: ❯ Loading plugins
    6:39:32 PM:    - @netlify/[email protected] from Netlify app
    6:39:33 PM: ​
    6:39:33 PM: ────────────────────────────────────────────────────────────────
    6:39:33 PM:   1. @netlify/plugin-gatsby (onPreBuild event)                  
    6:39:33 PM: ────────────────────────────────────────────────────────────────
    6:39:33 PM: ​
    6:39:35 PM: Found a Gatsby cache. We’re about to go FAST. ⚑️
    6:39:41 PM: ​
    6:39:41 PM: ────────────────────────────────────────────────────────────────
    6:39:41 PM:   Plugin "@netlify/plugin-gatsby" failed                        
    6:39:41 PM: ────────────────────────────────────────────────────────────────
    6:39:41 PM: ​
    6:39:41 PM:   Error message
    6:39:41 PM:   Error: Could not load gatsby-config.js
    6:39:41 PM:   Missing binding /opt/build/repo/node_modules/node-sass/vendor/linux-x64-72/binding.node
    6:39:41 PM:   Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x
    6:39:41 PM: ​
    6:39:41 PM:   Found bindings for the following environments:
    6:39:41 PM:     - Linux 64-bit with Node.js 15.x
    6:39:41 PM: ​
    6:39:41 PM:   This usually happens because your environment has changed since running `npm install`.
    6:39:41 PM:   Run `npm rebuild node-sass` to download the binding for your current environment.
    6:39:41 PM: ​
    6:39:41 PM:   Plugin details
    6:39:41 PM:   Package:        @netlify/plugin-gatsby
    6:39:41 PM:   Version:        1.0.3
    6:39:41 PM:   Repository:     git+https://github.com/netlify/netlify-plugin-gatsby.git
    6:39:41 PM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-gatsby
    6:39:41 PM:   Report issues:  https://github.com/netlify/netlify-plugin-gatsby/issues
    6:39:41 PM: ​
    6:39:41 PM:   Error location
    6:39:41 PM:   In "onPreBuild" event in "@netlify/plugin-gatsby" from Netlify app
    6:39:41 PM:       at module.exports (/node_modules/node-sass/lib/binding.js:15:13)
    6:39:41 PM: ​
    6:39:41 PM:   Resolved config
    6:39:41 PM:   build:
    6:39:41 PM:     command: npm run build:production
    6:39:41 PM:     commandOrigin: ui
    6:39:41 PM:     environment:
    6:39:41 PM:       - BUTTONDOWN_API_KEY
    6:39:41 PM:       - CCN_ENDPOINT
    6:39:41 PM:       - GATSBY_BUGSNAG_API_KEY
    6:39:41 PM:       - GATSBY_SHOPIFY_TOKEN
    6:39:41 PM:       - GRAPHQL_SECRET
    6:39:41 PM:       - GRAPHQL_SECRETKEY
    6:39:41 PM:       - GRAPHQL_URL
    6:39:41 PM:       - GS_COVID_ID
    6:39:41 PM:       - GS_PRIVATE_EMAIL
    6:39:41 PM:       - GS_PRIVATE_KEY
    6:39:41 PM:       - GS_PRIVATE_KEY_ID
    6:39:41 PM:       - GS_REGISTRATIONPERM_ID
    6:39:41 PM:       - GS_REGISTRATION_ID
    6:39:41 PM:       - GTAG_ID
    6:39:41 PM:       - HASURA_GRAPHQL_ADMIN_SECRET
    6:39:41 PM:       - PERCY_TOKEN
    6:39:41 PM:       - REVIEW_ID
    6:39:41 PM:       - RO_ENDPOINT
    6:39:41 PM:       - RWGPS_API_KEY
    6:39:41 PM:       - SENDGRID_API_KEY
    6:39:41 PM:       - SLACK_REGISTRATION_WEBHOOK
    6:39:41 PM:     publish: /opt/build/repo/public
    6:39:41 PM:     publishOrigin: ui
    6:39:41 PM:   functionsDirectory: /opt/build/repo/functions
    6:39:41 PM:   plugins:
    6:39:41 PM:     - inputs: {}
    6:39:41 PM:       origin: ui
    6:39:41 PM:       package: '@netlify/plugin-gatsby'
    6:39:41 PM:   redirects:
    6:39:41 PM:     - from: /covid
    6:39:41 PM:       status: 301
    6:39:41 PM:       to: /registration/covid
    6:39:41 PM:     - from: /register
    6:39:41 PM:       status: 301
    6:39:41 PM:       to: /registration
    6:39:41 PM:   redirectsOrigin: config
    6:39:41 PM: Caching artifacts
    6:39:41 PM: Started saving node modules
    6:39:41 PM: Finished saving node modules
    6:39:41 PM: Started saving build plugins
    6:39:41 PM: Finished saving build plugins
    6:39:41 PM: Started saving yarn cache
    6:40:03 PM: Finished saving yarn cache
    6:40:03 PM: Started saving pip cache
    6:40:03 PM: Finished saving pip cache
    6:40:03 PM: Started saving emacs cask dependencies
    6:40:03 PM: Finished saving emacs cask dependencies
    6:40:03 PM: Started saving maven dependencies
    6:40:03 PM: Finished saving maven dependencies
    6:40:03 PM: Started saving boot dependencies
    6:40:03 PM: Finished saving boot dependencies
    6:40:03 PM: Started saving rust rustup cache
    6:40:03 PM: Finished saving rust rustup cache
    6:40:03 PM: Started saving go dependencies
    6:40:05 PM: Finished saving go dependencies
    6:40:05 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
    6:40:05 PM: Creating deploy upload records
    6:40:05 PM: Failing build: Failed to build site
    6:40:05 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
    6:40:05 PM: Finished processing build request in 3m12.559617364s
    

    Can you submit a pull request?

    Yes! I'll need help knowing what to change, but happy to lend a hand.

    Thanks for the hard work!

    bug 
    opened by emarchak 11
  • Netlify DSG page failed with 500 server error when using custom source plugin.

    Netlify DSG page failed with 500 server error when using custom source plugin.

    Describe the bug

    Hi, we are upgrading to gatsbyv4 and using netlify to host our site. While adding DSG support for several pages. Unexpected behavior was seen. When the site is deployed for the very first time. DSG pages give 500 internal errors on DSG enabled pages.

    When I redeploy without clearing cache these pages automatically work. These are the logs for the _dsg function.

    Feb 13, 10:21:00 PM: ebd60328 error Error: ENOENT: no such file or directory, open '/opt/build/repo/.cache/caches/gatsby-source-custom-api/44b5d8b9f62a9d1bf85708e10185900a/EoHoW6.jpeg' Feb 13, 10:21:00 PM: ebd60328 at Object.openSync (fs.js:497:3) Feb 13, 10:21:00 PM: ebd60328 at Object.readFileSync (fs.js:393:35)Feb 13, 10:21:00 PM: ebd60328 at Object.lfs.<computed> [as readFileSync] (/var/task/.netlify/functions-internal/__dsg/__dsg.js:3284:24)Feb 13, 10:21:00 PM: ebd60328 at Function.hasha.fromFileSync (/var/task/.cache/query-engine/index.js:175592:54) Feb 13, 10:21:00 PM: ebd60328 at createFileHash (/var/task/.cache/query-engine/index.js:175130:25) Feb 13, 10:21:00 PM: ebd60328 at /var/task/.cache/query-engine/index.js:175283:22 Feb 13, 10:21:00 PM: ebd60328 at Array.map (<anonymous>) Feb 13, 10:21:00 PM: ebd60328 at createInternalJob (/var/task/.cache/query-engine/index.js:175280:50) Feb 13, 10:21:00 PM: ebd60328 at /var/task/.cache/query-engine/index.js:177000:23Feb 13, 10:21:00 PM: ebd60328 at /var/task/.cache/query-engine/index.js:52897:18Feb 13, 10:21:00 PM: ebd60328 at /var/task/.cache/query-engine/index.js:26666:12Feb 13, 10:21:00 PM: ebd60328 at Object.doubleBoundActionCreators.<computed> [as createJobV2] (/var/task/.cache/query-engine/index.js:160607:20) Feb 13, 10:21:00 PM: ebd60328 at createJob (/var/task/.cache/query-engine/index.js:186952:27)Feb 13, 10:21:00 PM: ebd60328 at batchQueueImageResizing (/var/task/.cache/query-engine/index.js:187044:27) Feb 13, 10:21:00 PM: ebd60328 at generateImageData (/var/task/.cache/query-engine/index.js:193095:48) Feb 13, 10:21:00 PM: ebd60328 at resolve (/var/task/.cache/query-engine/index.js:292538:25) Feb 13, 10:21:00 PM: ebd60328 Duration: 100.57 ms Memory Usage: 578 MB

    It's very unclear to me why this is happening. gatsby-plugin-image is supposed to cache all the images automatically. Or the reason is because netlify-plugin-gatsby still doesn't support images as mentioned that staticImage and some others are still not supported?

    Sidenote: We are using aws s3 for hosting images.

    Expected Behavior: If the DSG pages are being rendered properly on second deploy then they are supposed to be working on first ever deployment also.

    Screenshots

    image

    Link to URL with DSG enabled: https://62012bfbdcbc1d0008521095--tender-galileo-fdd375.netlify.app/products/1200-peak-amp-portable-car-jump-starterportable-power-station-with-120-psi-compressor-and-500-watt-p/ This URL might be working right now for you because I've already redeployed the site.

    bug 
    opened by MuhammadHadiofficial 10
  • Clear the cache if a build fails

    Clear the cache if a build fails

    Thanks for suggesting a new feature!

    Please fill in the sections below.

    Which problem is this feature request solving?

    We're getting bad api responses cached, resulting in chains of broken builds. The bad response results in a Gatsby error in gatsby-node's onPostBuild, but the cache saves the build anyways, and then the next build fails because of the cached bad response, and the next, and the next, etc.

    I've tried throwing errors inside the build process and running gatsby clean after the build command if there's an error, but that only remove .cache & .public, not whatever's attached to utils.cache.

    We're working on upgrading to gatsby v4 to use the newer version, but unless I'm missing something skimming the source it looks like the same behaviour there.

    I think the cache should, by default, be cleared if a build fails. We could check for the status code in onPostBuild and utils.cache.remove() if non-zero. No point in saving a bad image, especially if it leads to an endless chain of broken builds requiring manual intervention

    enhancement 
    opened by aponty 10
  • Failing build: Failed to upload file: __ssr Failed to upload file: __dsg

    Failing build: Failed to upload file: __ssr Failed to upload file: __dsg

    Describe the bug

    Build fails for gatsby v4.1.0 and @netlify/[email protected] while works with stable version of @netlify/plugin-gatsby (of course without dsg and ssr)

    Here the logs:

    10:54:59 AM: ────────────────────────────────────────────────────────────────
    10:54:59 AM:   6. Deploy site                                                
    10:54:59 AM: ────────────────────────────────────────────────────────────────
    10:54:59 AM: ​
    10:54:59 AM: Starting to deploy site from 'public'
    10:55:14 AM: Creating deploy tree asynchronously
    10:55:14 AM: Creating deploy upload records
    10:55:20 AM: 79 new files to upload
    10:55:20 AM: 3 new functions to upload
    10:55:26 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:26 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:28 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:28 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:30 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:30 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:31 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:32 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:34 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:35 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:38 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:38 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:42 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:42 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:50 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:51 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:58 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:55:59 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:56:12 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:56:18 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:56:23 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:56:34 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:56:51 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
    10:56:51 AM: Failed to upload file: __ssr
    10:56:52 AM: Failed to upload file: __dsg
    10:56:52 AM: Site deploy was successfully initiated
    10:56:52 AM: Execution cancelled
    10:56:52 AM: Error running command: Command was cancelled
    10:56:52 AM: Failing build: Failed to build site
    

    Environment Netlify CI: node v14.18.1 (npm v6.14.15) @netlify/build 18.21.3 npmPackages: @netlify/plugin-gatsby: ^2.0.0-beta => 2.0.0-zz-beta.0 gatsby: ^4.1.0 => 4.1.0

    bug 
    opened by d4v1d82 9
  • Optionally load Gatsby datastore into lambdas after deploy

    Optionally load Gatsby datastore into lambdas after deploy

    We currently include the Gatsby lmdb datastore (data.mdb) in the lambda bundle, then move it into the tmp dir at first run, because it needs to be in a writeable filesystem. The problem with this is that for large sites the database can be larger than the maximum lambda deploy size. We could avoid this by instead loading the db from the CDN at first run. This would mean its size would be limited only by the max tmp dir size (512MB), but it would have a cold start cost. It would also mean the db was technically exposed to the internet. However if we create a filename that is very long and random then that is equivalent to password protection. The filename could be bundled inside the lambda instead, along with a hash of the file.

    Because of the tradeoff, it would make sense for this to be optional. We could either do it automatically if we see the datastore is larger than a certain size, or we could use an env var and give an error message that suggests enabling it if the db is too large.

    opened by ascorbic 7
  • Instead of showing the 404 page, non-existing pages are pointing to Netlify functions

    Instead of showing the 404 page, non-existing pages are pointing to Netlify functions

    When using the default gatsby-plugin-netlify and @netlify/plugin-gatsby using the instructions on the README, all Not Found Urls are being redirected to this weird page that seems to be trying to load a Netlify Function. The page returns a 502 status and shows

    {"errorType":"Error","errorMessage":"ENOENT: no such file or directory, lstat '/var/task/.cache/data'","trace":["Error: ENOENT: no such file or directory, lstat '/var/task/.cache/data'","    at Object.lstatSync (fs.js:1119:3)","    at Object.lstatSync (/var/task/.netlify/functions-internal/__dsg/__dsg.js:466:38)","    at statFunc (/var/task/.netlify/functions-internal/__dsg/__dsg.js:1172:106)","    at getStatsSync (/var/task/.netlify/functions-internal/__dsg/__dsg.js:1173:23)","    at Object.checkPathsSync (/var/task/.netlify/functions-internal/__dsg/__dsg.js:1211:37)","    at copySync2 (/var/task/.netlify/functions-internal/__dsg/__dsg.js:1311:42)","    at prepareFilesystem (/var/task/.netlify/functions-internal/__dsg/__dsg.js:2929:32)","    at getHandler (/var/task/.netlify/functions-internal/__dsg/__dsg.js:2954:3)","    at Object.<anonymous> (/var/task/.netlify/functions-internal/__dsg/__dsg.js:3002:45)","    at Module._compile (internal/modules/cjs/loader.js:1085:14)"]}
    

    I am using the latest Gatsby v4 and the latest Netlify plugins, and only do calls to createPage in gatsby-node to create content pages. I have no SSR or DSG pages. Everything is generated into a static file.

    During the Netlify build, this message caught my attention:

    1:31:13 AM: ────────────────────────────────────────────────────────────────
    1:31:13 AM:   3. @netlify/plugin-gatsby (onBuild event)                     
    1:31:13 AM: ────────────────────────────────────────────────────────────────
    1:31:13 AM: ​
    1:31:13 AM: Netlify configuration property "redirects" value changed to [ { from: '/*', to: '/.netlify/functions/__dsg', status: 200 } ].
    
    bug 
    opened by Bartmr 7
  • chore(main): release plugin-gatsby 3.5.1

    chore(main): release plugin-gatsby 3.5.1

    :robot: I have created a release beep boop

    3.5.1 (2023-01-05)

    Bug Fixes

    • deps: update dependency @netlify/ipx to ^1.3.3 (#538) (d9a96cc)

    This PR was generated with Release Please. See documentation.

    type: chore autorelease: pending 
    opened by token-generator-app[bot] 1
  • chore(deps): update dependency sanitize-html to 2.3.2 [security]

    chore(deps): update dependency sanitize-html to 2.3.2 [security]

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | |---|---| | sanitize-html | 1.27.5 -> 2.3.2 |

    GitHub Vulnerability Alerts

    CVE-2021-26540

    Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the "allowedIframeHostnames" option when the "allowIframeRelativeUrls" is set to true, which allows attackers to bypass hostname whitelist for iframe element, related using an src value that starts with "/\example.com".

    CVE-2021-26539

    Apostrophe Technologies sanitize-html before 2.3.1 does not properly handle internationalized domain name (IDN) which could allow an attacker to bypass hostname whitelist validation set by the "allowedIframeHostnames" option.


    Configuration

    πŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    type: chore 
    opened by renovate[bot] 1
  • [Bug]: netlify build fails with gatsby v5 on node 18 with yarn2 pnp,

    [Bug]: netlify build fails with gatsby v5 on node 18 with yarn2 pnp, "Cannot find module 'postcss-color-function'"

    Summary

    When using a gatsby-config.js that includes require statements these does not seem to be resolved by netlify-plugin-gatsby.

    Steps to reproduce

    1. create a new gatsby site
    2. add the following code to your gatsby-config.js
      {
        resolve: 'gatsby-plugin-postcss',
        options: {
          postCssPlugins: [require('postcss-color-function'), require('cssnano')()],
        },
      },
      
    3. with the following `netlify

    A link to a reproduction repository

    No response

    Plugin version

    3.4.8

    More information about your build

    • [ ] I am building using the CLI
    • [X] I am building using file-based configuration (netlify.toml)

    What OS are you using?

    Mac OS

    Your netlify.toml file

    `netlify.toml`
    [[plugins]]
      package = "@netlify/plugin-gatsby"
    
    [build]
    ## Yarn 3 cache does not work out of the box as of Jan 2022. Context:
    ## https://github.com/netlify/build/issues/1535#issuecomment-1021947989
    [build.environment]
    YARN_CACHE_FOLDER = "/opt/buildhome/.yarn_cache"
    YARN_VERSION = "3.2.4"
    

    Configuration

    `gatsby-config.js` and options
    /* eslint-disable @typescript-eslint/no-var-requires */
    const path = require('path');
    
    module.exports = {
      flags: {
        DEV_SSR: true,
      },
      graphqlTypegen: true,
      siteMetadata: {
        title: 'Site',
        description: 'Site',
        siteUrl: 'https://site.url', // full path to blog - no ending slash
      },
      mapping: {
        // eslint-disable-next-line @typescript-eslint/naming-convention
        'MarkdownRemark.frontmatter.author': 'AuthorYaml.name',
      },
      plugins: [
        'gatsby-plugin-image',
        {
          resolve: 'gatsby-plugin-sharp',
          options: {
            defaultQuality: 100,
            stripMetadata: true,
          },
        },
        'gatsby-transformer-sharp',
    
        'gatsby-plugin-sitemap',
        {
          resolve: 'gatsby-source-filesystem',
          options: {
            name: 'content',
            path: path.join(__dirname, 'src', 'content'),
          },
        },
        {
          resolve: 'gatsby-transformer-remark',
          options: {
            plugins: [
              {
                resolve: 'gatsby-remark-responsive-iframe',
                options: {
                  wrapperStyle: 'margin-bottom: 1rem',
                },
              },
              'gatsby-remark-prismjs',
              'gatsby-remark-copy-linked-files',
              'gatsby-remark-smartypants',
              {
                resolve: 'gatsby-remark-images',
                options: {
                  maxWidth: 1000,
                  quality: 100,
                  backgroundColor: '#191B1F',
                },
              },
            ],
          },
        },
        'gatsby-transformer-json',
        {
          resolve: 'gatsby-plugin-canonical-urls',
          options: {
            siteUrl: 'https://site.url',
          },
        },
        'gatsby-plugin-typescript',
        'gatsby-plugin-emotion',
        'gatsby-plugin-react-helmet',
        'gatsby-transformer-yaml',
        {
          resolve: 'gatsby-plugin-feed',
          options: {
            query: `
              {
                site {
                  siteMetadata {
                    title
                    description
                    siteUrl
                    site_url: siteUrl
                  }
                }
              }
            `,
            feeds: [
              {
                serialize: ({ query: { site, allMarkdownRemark } }) =>
                  allMarkdownRemark.edges.map(edge => ({
                    ...edge.node.frontmatter,
                    description: edge.node.excerpt,
                    date: edge.node.frontmatter.date,
                    url: `${site.siteMetadata.siteUrl}${edge.node.fields.slug}`,
                    guid: `${site.siteMetadata.siteUrl}${edge.node.fields.slug}`,
                    custom_elements: [{ 'content:encoded': edge.node.html }],
                  })),
                query: `{
      allMarkdownRemark(
        filter: {fields: {layout: {eq: "post"}}, frontmatter: {draft: {ne: true}}}
        sort: {frontmatter: {date: DESC}}
      ) {
        edges {
          node {
            excerpt
            html
            fields {
              slug
            }
            frontmatter {
              title
              date
            }
          }
        }
      }
    }`,
                output: '/rss.xml',
                title: 'Blog',
                match: '^/blog/',
              },
            ],
          },
        },
        {
          resolve: 'gatsby-plugin-postcss',
          options: {
            postCssPlugins: [require('postcss-color-function'), require('cssnano')()],
          },
        },
       
      ],
    };
    
    

    Environment

    Environment
    # Paste output from `npx envinfo` here.
    

    Gatsby info

    gatsby info
      System:
        OS: macOS 13.0.1
        CPU: (8) arm64 Apple M1 Pro
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.12.1 - /private/var/folders/qm/2wy0hxgs30q25ws7qgql07600000gn/T/xfs-81d3c4e5/node
        Yarn: 3.2.4 - /private/var/folders/qm/2wy0hxgs30q25ws7qgql07600000gn/T/xfs-81d3c4e5/yarn
        npm: 8.19.2 - ~/.volta/tools/image/node/18.12.1/bin/npm
      Browsers:
        Firefox: 107.0.1
        Safari: 16.1
    

    Your _redirects file

    `_redirects`
    # Paste content of your `_redirects` file here
    

    Builds logs (or link to your logs)

    Build logs
    ​
    10:29:46 AM: ────────────────────────────────────────────────────────────────
    10:29:46 AM:   1. netlify-plugin-gatsby-cache (onPreBuild event)             
    10:29:46 AM: ────────────────────────────────────────────────────────────────
    10:29:46 AM: ​
    10:29:46 AM: No Gatsby cache found. Building fresh.
    10:29:46 AM: ​
    10:29:46 AM: (netlify-plugin-gatsby-cache onPreBuild completed in 7ms)
    10:29:46 AM: ​
    10:29:46 AM: ────────────────────────────────────────────────────────────────
    10:29:46 AM:   2. @netlify/plugin-gatsby (onPreBuild event)                  
    10:29:46 AM: ────────────────────────────────────────────────────────────────
    10:29:46 AM: ​
    10:29:46 AM: No Gatsby cache found. Building fresh.
    10:29:46 AM: ​
    10:29:46 AM: ────────────────────────────────────────────────────────────────
    10:29:46 AM:   Plugin "@netlify/plugin-gatsby" failed                        
    10:29:46 AM: ────────────────────────────────────────────────────────────────
    10:29:46 AM: ​
    10:29:46 AM:   Error message
    10:29:46 AM:   Error: Could not load gatsby-config.js
    10:29:46 AM:   Cannot find module 'postcss-color-function'
    10:29:46 AM:   Require stack:
    10:29:46 AM:   - /opt/build/repo/gatsby-config.js
    10:29:46 AM:   - /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/helpers/config.js
    10:29:46 AM:   - /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/helpers/cache.js
    10:29:46 AM:   - /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/index.js
    10:29:46 AM: ​
    10:29:46 AM:   Plugin details
    10:29:46 AM:   Package:        @netlify/plugin-gatsby
    10:29:46 AM:   Version:        3.4.8
    10:29:46 AM:   Repository:     git+https://github.com/netlify/netlify-plugin-gatsby.git
    10:29:46 AM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-gatsby
    10:29:46 AM:   Report issues:  https://github.com/netlify/netlify-plugin-gatsby/issues
    10:29:46 AM: ​
    10:29:46 AM:   Error location
    10:29:46 AM:   In "onPreBuild" event in "@netlify/plugin-gatsby" from netlify.toml
    10:29:46 AM: ​
    10:29:46 AM:   Resolved config
    10:29:46 AM:   build:
    10:29:46 AM:     command: yarn build
    10:29:46 AM:     commandOrigin: ui
    10:29:46 AM:     environment:
    10:29:46 AM:       - YARN_CACHE_FOLDER
    10:29:46 AM:       - YARN_VERSION
    10:29:46 AM:     publish: /opt/build/repo/public
    10:29:46 AM:     publishOrigin: ui
    10:29:46 AM:   plugins:
    10:29:46 AM:     - inputs: {}
    10:29:46 AM:       origin: ui
    10:29:46 AM:       package: netlify-plugin-gatsby-cache
    10:29:48 AM: Creating deploy upload records
    10:29:46 AM:     - inputs: {}
    10:29:46 AM:       origin: config
    10:29:46 AM:       package: '@netlify/plugin-gatsby'
    10:29:47 AM: Caching artifacts
    10:29:48 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
    

    Function logs

    Function logs
    # Paste logs here
    
    type: bug 
    opened by rburgst 1
  • chore(deps): update dependency decode-uri-component to 0.2.1 [security]

    chore(deps): update dependency decode-uri-component to 0.2.1 [security]

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | |---|---| | decode-uri-component | 0.2.0 -> 0.2.1 |

    GitHub Vulnerability Alerts

    CVE-2022-38900

    decode-uri-component 0.2.0 is vulnerable to Improper Input Validation resulting in DoS.


    Configuration

    πŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    type: chore 
    opened by renovate[bot] 1
  • [Bug]: Error when building in netlify

    [Bug]: Error when building in netlify

    Summary

    ───────────────────────────────────────────────────────────────
    10:45:43 PM:   3. @netlify/plugin-gatsby (onBuild event)                     
    10:45:43 PM: ────────────────────────────────────────────────────────────────
    10:45:43 PM: ​
    10:45:43 PM: Enabling Gatsby API support
    10:45:43 PM: ​
    10:45:43 PM: ────────────────────────────────────────────────────────────────
    10:45:43 PM:   Plugin "@netlify/plugin-gatsby" internal error                
    10:45:43 PM: ────────────────────────────────────────────────────────────────
    10:45:43 PM: ​
    10:45:43 PM:   Error message
    10:45:43 PM:   Error: ENOENT: no such file or directory, copyfile '/opt/build/repo/node_modules/@netlify/plugin-gatsby/src/templates/ipx.ts' -> '.netlify/functions-internal/_ipx.ts'
    10:45:43 PM: ​
    10:45:43 PM:   Plugin details
    10:45:43 PM:   Package:        @netlify/plugin-gatsby
    10:45:43 PM:   Version:        3.4.8
    10:45:43 PM:   Repository:     git+https://github.com/netlify/netlify-plugin-gatsby.git
    10:45:43 PM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-gatsby
    10:45:43 PM:   Report issues:  https://github.com/netlify/netlify-plugin-gatsby/issues
    10:45:43 PM: ​
    10:45:43 PM:   Error location
    10:45:43 PM:   In "onBuild" event in "@netlify/plugin-gatsby" from netlify.toml and package.json
    10:45:43 PM: ​
    10:45:43 PM:   Error properties
    10:45:43 PM:   {
    10:45:43 PM:     errno: -2,
    10:45:43 PM:     code: 'ENOENT',
    10:45:43 PM:     syscall: 'copyfile',
    10:45:43 PM:     path: '/opt/build/repo/node_modules/@netlify/plugin-gatsby/src/templates/ipx.ts',
    10:45:43 PM:     dest: '.netlify/functions-internal/_ipx.ts'
    10:45:43 PM:   }
    10:45:43 PM: ​
    
    
    

    Steps to reproduce

    Happens when I deploy to gatsby

    versions:

    "@netlify/plugin-gatsby": "^3.4.8", "gatsby-plugin-netlify": "^5.0.1", "gatsby": "^4.24.0", "react": "^18.1.0",

    A link to a reproduction repository

    No response

    Plugin version

    3.4.8

    More information about your build

    • [X] I am building using the CLI
    • [X] I am building using file-based configuration (netlify.toml)

    What OS are you using?

    Mac OS

    Your netlify.toml file

    `netlify.toml`
    [[plugins]]
      package = "@netlify/plugin-gatsby"
    

    Configuration

    `gatsby-config.js` and options
    # Paste content of your `gatsby-config.js` file, and/or command line options here. Check there is no private info in there.
    

    Environment

    Environment
      System:
        OS: macOS 12.6
        CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
        Memory: 419.41 MB / 16.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
        Yarn: 1.22.17 - /usr/local/bin/yarn
        npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
      Browsers:
        Chrome: 107.0.5304.110
        Safari: 16.0
      npmPackages:
        @netlify/plugin-gatsby: ^3.4.8 => 3.4.8 
    

    Gatsby info

    gatsby info
      System:
        OS: macOS 12.6
        CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
        Yarn: 1.22.17 - /usr/local/bin/yarn
        npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
      Browsers:
        Chrome: 107.0.5304.110
        Safari: 16.0
      npmPackages:
        gatsby: ^4.24.0 => 4.24.8
        gatsby-omni-font-loader: ^2.0.2 => 2.0.2
        gatsby-plugin-cookiebot: ^1.0.3 => 1.0.3
        gatsby-plugin-create-client-paths: ^4.9.0 => 4.9.0
        gatsby-plugin-fullstory: ^4.24.0 => 4.24.0
        gatsby-plugin-google-analytics: ^4.24.0 => 4.24.0
        gatsby-plugin-google-fonts: ^1.0.1 => 1.0.1
        gatsby-plugin-google-tagmanager: ^4.24.0 => 4.24.0
        gatsby-plugin-image: ^2.24.0 => 2.24.0
        gatsby-plugin-manifest: ^4.24.0 => 4.24.0
        gatsby-plugin-mdx: ^4.3.0 => 4.3.0
        gatsby-plugin-netlify: ^5.0.1 => 5.0.1
        gatsby-plugin-offline: ^5.24.0 => 5.24.0
        gatsby-plugin-postcss: ^5.24.0 => 5.24.0
        gatsby-plugin-react-svg: ^3.3.0 => 3.3.0
        gatsby-plugin-sharp: ^4.24.0 => 4.24.0
        gatsby-plugin-sitemap: ^5.24.0 => 5.24.0
        gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.30 => 1.1.30
        gatsby-source-contentful: ^7.22.0 => 7.22.0
        gatsby-source-filesystem: ^4.24.0 => 4.24.0
        gatsby-transformer-remark: ^5.24.0 => 5.24.0
        gatsby-transformer-sharp: ^4.24.0 => 4.24.0
    

    Your _redirects file

    `_redirects`
    # Paste content of your `_redirects` file here
    

    Builds logs (or link to your logs)

    Build logs
    https://app.netlify.com/sites/vtlsuites/deploys/637ff3a74ae5280008653fb2
    

    Function logs

    Function logs
    # Paste logs here
    
    type: bug priority: medium 
    opened by Nimisoere 1
  • chore(deps): update dependency minimatch to 3.0.5 [security]

    chore(deps): update dependency minimatch to 3.0.5 [security]

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | |---|---| | minimatch | 3.0.4 -> 3.0.5 |

    GitHub Vulnerability Alerts

    CVE-2022-3517

    A vulnerability was found in the minimatch package. This flaw allows a Regular Expression Denial of Service (ReDoS) when calling the braceExpand function with specific arguments, resulting in a Denial of Service.


    Configuration

    πŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    type: chore 
    opened by renovate[bot] 1
Releases(plugin-gatsby-v3.5.0)
Owner
Netlify
Netlify builds, deploys and hosts your front-end
Netlify
Gatsby-blog-cosmicjs - πŸš€βš‘οΈ Blazing fast blog built with Gatsby and the Cosmic Headless CMS πŸ”₯

Gatsby + Cosmic This repo contains an example blog website that is built with Gatsby, and Cosmic. See live demo hosted on Netlify Uses the Cosmic Gats

Priya Chakraborty 0 Jan 29, 2022
Starter-gatsby-blog - Gatsby starter for a Contentful project from the community.

Contentful Gatsby Starter Blog Create a Gatsby blog powered by Contentful. Static sites are scalable, secure and have very little required maintenance

Priya Chakraborty 0 Jan 29, 2022
Easiest way to build documentation for your project. No config or build required, hosted on @netlify.

Hyperdocs is the simplest way you can create documentation for your project. It blends the best of all the other documentation tools in one. Hyperdocs

Lalit 76 Dec 22, 2022
Superlight vanilla javascript plugin, for modern web dropdowns. Supporting multi-options, search and images. Designed to be seamlessly themed

Superlight vanilla javascript dropdowns by LCweb Need to jump off of jQuery (or any other) dependency? Other packages are too heavy to just tweak sele

Luca 10 Dec 26, 2022
Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links

rebrandly-express Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links Rebra

null 3 Dec 13, 2022
JSON Visio is data visualization tool for your json data which seamlessly illustrates your data on graphs without having to restructure anything, paste directly or import file.

JSON Visio is data visualization tool for your json data which seamlessly illustrates your data on graphs without having to restructure anything, paste directly or import file.

Aykut Saraç 20.6k Jan 4, 2023
Netlify functions session cookie πŸͺ

netlify-functions-session-cookie ?? Cryptographically-signed session cookies for Netlify functions. Summary Install Concept and Usage API Environment

Matteo Cargnelutti 7 Jun 8, 2022
testing out ember + netlify's forms

survey-netlify I'm trying Ember + Netlify Forms. Will it work? Let's find out. Steps so far added prember and ember-cli-fastboot used the version of f

Melanie Sumner 3 Feb 14, 2022
A demo to show how to re-use Eleventy Image’s disk cache across Netlify builds.

Re-use Eleventy Image Disk Cache across Netlify Builds Live Demo This repository takes all of the high resolution browser logos and processes them thr

Eleventy 9 Apr 5, 2022
A peculiar little website that uses Eleventy + Netlify + Puppeteer to create generative poster designs

Garden β€” Generative Jamstack Posters "Garden" is an experiment in building creative, joyful online experiences using core web technologies. ?? Buildin

George Francis 13 Jun 13, 2022
This is a demo of updating a map to show air quality data for the user’s current location using Next.js Advanced Middleware, powered by Netlify Edge Functions.

Show Local Air Quality Based on the User's Location Use AQI data to show the air quality near the current user. This is built using Next.js Advanced M

Jason Lengstorf 8 Nov 4, 2022
πŸ€– Persist the Playwright executable between Netlify builds

?? Netlify Plugin Playwright Cache Persist the Playwright executables between Netlify builds. Why netlify-plugin-playwright-cache When you install pla

Hung Viet Nguyen 14 Oct 24, 2022
Get an isolated preview database for every Netlify Preview Deployment

Netlify Preview Database Plugin Create an isolated preview database for each preview deployment in Netlify Quickstart β€’ Website β€’ Docs β€’ Discord β€’ Twi

Snaplet 10 Nov 16, 2022
A new Node.js resource built using Gatsby.js with React.js, TypeScript, and Remark.

Nodejs.dev Nodejs.dev site built using Gatsby.js with React.js, TypeScript, SCSS, and Remark. You can find the latest Figma design protype here. ?? Ge

Node.js 2.2k Jan 5, 2023
React Gatsby static web tool for generative artists working on token based NFT artwork (ex: Artblocks)

token-art-tools React Gatsby static web tool for generative artists working on token/hash based NFT artwork (ex: Artblocks) https://ctrlshiftmake.gith

Owen Moore 71 Dec 15, 2022
GatsbyContactFormBasedOnFormikAnalysis - This is example contact form for gatsby framework.

Gatsby minimal starter ?? Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Bart 1 Jan 2, 2022
Gatsby-Formik-contact-form-with-backend-panel - Full working contact form with backend GUI panel.

Gatsby minimal starter ?? Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Bart 1 Jan 2, 2022
Gatsby-starter-minimal-blog - Typography driven, feature-rich blogging theme with minimal aesthetics.

Gatsby-starter-minimal-blog - Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code blocks such as live preview, line numbers, and line highlighting.

Priya Chakraborty 0 Jan 29, 2022
GatsbyConf - Decoupling Drupal Using Gatsby: A Crash Course workshop

GatsbyConf - Decoupling Drupal Using Gatsby: A Crash Course workshop

Octahedroid 7 Sep 29, 2022