[Bug]: Netlify CI builds failing with error Cannot find module 'common-tags'
MAU-Estate opened this issue · 2 comments
Summary
Previous to December 7, 2022 Netlify automatic deploys using a connected git repo with our Gatsby site worked fine. On December 7 they began failing with no major changes to the repo that would seem to effect build.
I've troubleshooted some related issues with the build but the root cause seems to be this package:
Plugin "@netlify/plugin-gatsby" internal error
Error message
Could not import plugin:
Error: Cannot find module 'common-tags'
Require stack:
/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/index.js
Plugin details
Package: @netlify/plugin-gatsby
Version: 3.6.2
Here is a screenshot. For the complete log please see the build logs section below.
Steps to reproduce
This is a live Sanity project that will only build properly with a Sanity CMS connected. To keep our CMS data safe here are instructions to recreate the entire project on your own Sanity instance:
Part 1 - To build the site locally
- Clone the public reproduction repo: https://github.com/MAU-Estate/public-testing-repo
- Create your own blank Sanity CMS project at Sanity.io
- Add your own Sanity projectId to the following files:
- studio/sanity.json
- web/.env.production
- web/client-config.js
- Use node version 12.18.0 (see .nvmrc file)
- Run
npm install --legacy-peer-deps
- Deploy schemas to Sanity Studio with
graphql-deploy
command in project root directory - See that it runs locally with
npm run dev
. The site will be live at localhost:8000 (you'll have to whitelist your localhost on the Sanity CMS of course) - You may need to build the project with
npm run build
- You will need to add your Sanity project ID and API keys to your Netlify environment variables
- Deploy your local branch manually to Netlify using the CLI commands
netlify deploy
ornetlify deploy --prod
to see that it works
Part 2 - Getting the repo to fail using Netlify CI automatic deploys
- Push your local branch to your own repo on your own github org
- Connect a netlify site to deploy from the repo
- Automatic deploys from the repo will fail
A link to a reproduction repository
https://github.com/MAU-Estate/public-testing-repo
Plugin version
3.6.2
More information about your build
- I am building using the CLI
- I am building using file-based configuration (
netlify.toml
)
What OS are you using?
Mac OS
Your netlify.toml file
`netlify.toml`
[build]
functions = "functions"
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
Configuration
`gatsby-config.js` and options
// Load variables from `.env` as soon as possible
require('dotenv').config({
path: `.env.${process.env.NODE_ENV || 'development'}`,
})
const clientConfig = require('./client-config')
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
flags: {
FAST_DEV: true,
DEV_SSR: false,
},
plugins: [
'gatsby-plugin-postcss',
'gatsby-plugin-react-helmet',
{
resolve: `gatsby-plugin-sharp`,
options: {
defaults: {
formats: [`auto`, `webp`],
placeholder: `blurred`,
defaultQuality: 50,
backgroundColor: `transparent`,
},
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-image`,
{
resolve: `gatsby-plugin-purgecss`,
options: {
printRejected: false,
tailwind: true,
},
},
{
resolve: 'gatsby-plugin-svgr',
options: {
prettier: true,
svgo: true,
replaceAttrValues: {
'#000000': 'currentColor',
'#000': 'currentColor',
},
},
},
`gatsby-plugin-modal-routing-3`,
{
resolve: 'gatsby-plugin-sanity-image',
options: {
...clientConfig.sanity,
customImageTypes: ['SanityPreviewImage', 'SanityFigure', 'SanitySlide'],
defaultImageConfig: {
quality: 35,
maxWidth: 1000,
fit: 'clip',
auto: 'format',
},
},
},
{
resolve: 'gatsby-source-sanity',
options: {
...clientConfig.sanity,
token: process.env.SANITY_READ_TOKEN,
watchMode: !isProd,
overlayDrafts: !isProd,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `maryannunger.com`,
short_name: `maryannunger`,
description: 'Website for the estate of Mary Ann Unger.',
start_url: `/`,
background_color: `#1f1f1f`,
theme_color: `#1f1f1f`,
display: `minimal-ui`,
icon: 'src/assets/images/favicon.png',
},
},
{
resolve: `gatsby-plugin-netlify`,
},
],
}
Environment
Environment
# Paste output from `npx envinfo` here.
Gatsby info
gatsby info
System:
OS: macOS 12.6
CPU: (8) x64 Apple M1
Memory: 245.78 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
Browsers:
Chrome: 114.0.5735.90
Safari: 16.3
Your _redirects file
`_redirects`
/free-standing /work
/wall-mounted /work
/small-bronzes /work
/public-art /work
/works-on-paper /work
/bio /#intro
/obituary /#intro
https://maue.netlify.app/* https://www.maryannunger.com/:splat 301!
https://www.maryannungerestate.com/* https://www.maryannunger.com/:splat 301!
https://maryannungerestate.com/* https://www.maryannunger.com/:splat 301!
Builds logs (or link to your logs)
Build logs
2:43:36 PM: Build ready to start
2:43:38 PM: build-image version: 4b067841aaa59ef71931d3505b98c2bc3e63f36f (focal)
2:43:38 PM: buildbot version: 502be6f76f3bdc8995419864b1fdcf93564f89d8
2:43:38 PM: Fetching cached dependencies
2:43:38 PM: Failed to fetch cache, continuing with build
2:43:38 PM: Starting to prepare the repo for build
2:43:38 PM: No cached dependencies found. Cloning fresh repo
2:43:38 PM: git clone --filter=blob:none https://github.com/MAU-Estate/sanity-gatsby-blog
2:43:39 PM: Preparing Git Reference refs/heads/staging
2:43:40 PM:
❯ Initial build environment
baseRelDir: true
branch: staging
context: branch-deploy
cwd: /opt/build/repo
featureFlags: []
mode: buildbot
repositoryRoot: /opt/build/repo
siteId: 52fe0e19-432e-4d6a-b09a-21f0438e0311
❯ UI build settings
baseRelDir: true
build:
base: /
command: npm run build-web
environment:
- MAILCHIMP_API_KEY
- NETLIFY_BUILD_DEBUG
- SANITY_DEPLOY_STUDIO_TOKEN
publish: web/public
plugins:
- inputs: {}
package: '@netlify/plugin-gatsby'
❯ Resolved build environment
branch: staging
buildDir: /opt/build/repo
context: branch-deploy
env: []
❯ Resolved config
build:
base: /opt/build/repo
command: npm run build-web
commandOrigin: ui
environment:
- MAILCHIMP_API_KEY
- NETLIFY_BUILD_DEBUG
- SANITY_DEPLOY_STUDIO_TOKEN
publish: /opt/build/repo/web/public
publishOrigin: ui
functionsDirectory: /opt/build/repo/web/functions
plugins:
- inputs: {}
origin: ui
package: '@netlify/plugin-gatsby'
2:43:40 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: '' versus '/' in the Netlify UI
2:43:41 PM: Starting to install dependencies
2:43:41 PM: Python version set to 3.8
2:43:41 PM: Attempting Ruby version 2.7.1, read from environment
2:43:41 PM: Required ruby-2.7.1 is not installed - installing.
2:43:41 PM: Searching for binary rubies, this might take some time.
2:43:41 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.7.1.tar.bz2
2:43:41 PM: Checking requirements for ubuntu.
2:43:42 PM: Requirements installation successful.
2:43:42 PM: ruby-2.7.1 - #configure
2:43:42 PM: ruby-2.7.1 - #download
2:43:42 PM: ruby-2.7.1 - #validate archive
2:43:45 PM: ruby-2.7.1 - #extract
2:43:47 PM: ruby-2.7.1 - #validate binary
2:43:47 PM: ruby-2.7.1 - #setup
2:43:47 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1@global
2:43:47 PM: ruby-2.7.1 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
2:43:47 PM: ruby-2.7.1 - #generating global wrappers........
2:43:48 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1
2:43:48 PM: ruby-2.7.1 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
2:43:48 PM: ruby-2.7.1 - #generating default wrappers........
2:43:48 PM: Using /opt/buildhome/.rvm/gems/ruby-2.7.1
2:43:48 PM: Using Ruby version 2.7.1
2:43:49 PM: Started restoring cached go cache
2:43:49 PM: Finished restoring cached go cache
2:43:49 PM: Installing Go version 1.14.4 (requested 1.14.4)
2:43:53 PM: go version go1.14.4 linux/amd64
2:43:53 PM: Using PHP version 8.0
2:43:53 PM: Attempting Node.js version '14.21.3' from .nvmrc
2:43:54 PM: Downloading and installing node v14.21.3...
2:43:54 PM: Downloading https://nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.xz...
2:43:54 PM: Computing checksum with sha256sum
2:43:54 PM: Checksums matched!
2:43:56 PM: Now using node v14.21.3 (npm v6.14.18)
2:43:56 PM: Enabling Node.js Corepack
2:43:56 PM: Started restoring cached build plugins
2:43:56 PM: Finished restoring cached build plugins
2:43:56 PM: Started restoring cached corepack dependencies
2:43:56 PM: Finished restoring cached corepack dependencies
2:43:56 PM: No npm workspaces detected
2:43:56 PM: Started restoring cached node modules
2:43:56 PM: Finished restoring cached node modules
2:43:56 PM: Installing npm packages using npm version 6.14.18
2:43:57 PM: npm WARN deprecated @evocateur/pacote@9.6.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2:43:57 PM: npm WARN deprecated read-package-tree@5.3.1: The functionality that this package provided is now in @npmcli/arborist
2:43:58 PM: npm WARN deprecated @evocateur/libnpmaccess@3.1.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2:43:58 PM: npm WARN deprecated @evocateur/npm-registry-fetch@4.0.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2:43:58 PM: npm WARN deprecated readdir-scoped-modules@1.1.0: This functionality has been moved to @npmcli/fs
2:43:59 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
2:43:59 PM: npm WARN deprecated @evocateur/libnpmpublish@1.2.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2:43:59 PM: npm WARN deprecated node-fetch-npm@2.0.4: This module is not used anymore, npm uses minipass-fetch for its fetch implementation now
2:44:01 PM: npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
2:44:01 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2:44:02 PM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
2:44:02 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
2:44:02 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
2:44:02 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
2:44:02 PM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
2:44:08 PM: > maue@1.0.0 postinstall /opt/build/repo
2:44:08 PM: > lerna bootstrap
2:44:08 PM: lerna notice cli v3.22.1
2:44:08 PM: lerna info ci enabled
2:44:08 PM: lerna info Bootstrapping 2 packages
2:44:08 PM: lerna info Installing external dependencies
2:44:55 PM: lerna info Symlinking packages and binaries
2:44:55 PM: lerna success Bootstrapped 2 packages
2:44:55 PM: npm notice created a lockfile as package-lock.json. You should commit this file.
2:44:56 PM: npm WARN @octokit/plugin-request-log@1.0.4 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
2:44:56 PM: added 812 packages from 388 contributors and audited 812 packages in 59.108s
2:44:56 PM: 67 packages are looking for funding
2:44:56 PM: run `npm fund` for details
2:44:56 PM: found 22 vulnerabilities (4 moderate, 16 high, 2 critical)
2:44:56 PM: run `npm audit fix` to fix them, or `npm audit` for details
2:44:56 PM: npm packages installed
2:44:56 PM: Install dependencies script success
2:44:56 PM: Starting build script
2:44:57 PM: Detected 0 framework(s)
2:44:57 PM: Section completed: initializing
2:44:58 PM:
2:44:58 PM: Netlify Build
2:44:58 PM: ────────────────────────────────────────────────────────────────
2:44:58 PM:
2:44:58 PM: ❯ Version
2:44:58 PM: @netlify/build 29.11.6
2:44:58 PM:
2:44:58 PM: ❯ Flags
2:44:58 PM: apiHost: api.netlify.com
2:44:58 PM: baseRelDir: true
2:44:58 PM: branch: staging
2:44:58 PM: buildId: 647643d8bdc8ff0008412872
2:44:58 PM: buildbotServerSocket: /tmp/netlify-buildbot-socket
2:44:58 PM: cacheDir: /opt/build/cache
2:44:58 PM: cachedConfigPath: /tmp/netlify_config.json
2:44:58 PM: context: branch-deploy
2:44:58 PM: cwd: /opt/build/repo
2:44:58 PM: deployId: 647643d8bdc8ff0008412874
2:44:58 PM: edgeFunctionsDistDir: /tmp/edge-647643d8bdc8ff0008412874
2:44:58 PM: featureFlags:
2:44:58 PM: - edge_functions_cache_cli
2:44:58 PM: - edge_functions_system_logger
2:44:58 PM: framework: unknown
2:44:58 PM: functionsDistDir: /tmp/zisi-647643d8bdc8ff0008412874
2:44:58 PM: mode: buildbot
2:44:58 PM: nodePath: /opt/buildhome/.nvm/versions/node/v14.21.3/bin/node
2:44:58 PM: repositoryRoot: /opt/build/repo
2:44:58 PM: saveConfig: true
2:44:58 PM: sendStatus: true
2:44:58 PM: siteId: 52fe0e19-432e-4d6a-b09a-21f0438e0311
2:44:58 PM: statsd:
2:44:58 PM: host: 10.65.141.7
2:44:58 PM: port: 8125
2:44:58 PM: systemLogFile: 3
2:44:58 PM: testOpts:
2:44:58 PM: silentLingeringProcesses: ''
2:44:58 PM:
2:44:58 PM: ❯ Current directory
2:44:58 PM: /opt/build/repo
2:44:58 PM:
2:44:58 PM: ❯ Config file
2:44:58 PM: No config file was defined: using default values.
2:44:58 PM:
2:44:58 PM: ❯ Resolved config
2:44:58 PM: build:
2:44:58 PM: base: /opt/build/repo
2:44:58 PM: command: npm run build-web
2:44:58 PM: commandOrigin: ui
2:44:58 PM: environment:
2:44:58 PM: - MAILCHIMP_API_KEY
2:44:58 PM: - NETLIFY_BUILD_DEBUG
2:44:58 PM: - SANITY_DEPLOY_STUDIO_TOKEN
2:44:58 PM: publish: /opt/build/repo/web/public
2:44:58 PM: publishOrigin: ui
2:44:58 PM: functionsDirectory: /opt/build/repo/web/functions
2:44:58 PM: plugins:
2:44:58 PM: - inputs: {}
2:44:58 PM: origin: ui
2:44:58 PM: package: '@netlify/plugin-gatsby'
2:44:58 PM:
2:44:58 PM: ❯ Context
2:44:58 PM: branch-deploy
2:44:58 PM:
2:44:58 PM: ❯ Available plugins
2:44:58 PM: - @21yunbox/netlify-plugin-21yunbox-deploy-to-china-cdn@1.0.7
2:44:58 PM: - @algolia/netlify-plugin-crawler@1.0.0
2:44:58 PM: - @bharathvaj/netlify-plugin-airbrake@1.0.2
2:44:58 PM: - @chiselstrike/netlify-plugin@0.1.0
2:44:58 PM: - @commandbar/netlify-plugin-commandbar@0.0.4
2:44:58 PM: - @helloample/netlify-plugin-replace@1.1.4
2:44:58 PM: - @netlify/feature-package-pilot@0.1.11
2:44:58 PM: - @netlify/plugin-angular-universal@1.0.1
2:44:58 PM: - @netlify/plugin-contentful-buildtime@0.0.3
2:44:58 PM: - @netlify/plugin-emails@1.0.3
2:44:58 PM: - @netlify/plugin-gatsby@3.6.2
2:44:58 PM: - @netlify/plugin-lighthouse@4.1.1
2:44:58 PM: - @netlify/plugin-nextjs@4.37.4
2:44:58 PM: - @netlify/plugin-sitemap@0.8.1
2:44:58 PM: - @newrelic/netlify-plugin@1.0.2
2:44:58 PM: - @sentry/netlify-build-plugin@1.1.1
2:44:58 PM: - @snaplet/netlify-preview-database-plugin@2.0.0
2:44:58 PM: - @takeshape/netlify-plugin-takeshape@1.0.0
2:44:58 PM: - @vgs/netlify-plugin-vgs@0.0.2
2:44:58 PM: - netlify-build-plugin-dareboost@1.2.1
2:44:58 PM: - netlify-build-plugin-debugbear@1.0.6
2:44:58 PM: - netlify-build-plugin-perfbeacon@1.0.3
2:44:58 PM: - netlify-build-plugin-speedcurve@2.0.0
2:44:58 PM: - netlify-deployment-hours-plugin@0.0.10
2:44:58 PM: - netlify-plugin-a11y@0.0.12
2:44:58 PM: - netlify-plugin-add-instagram@0.2.2
2:44:58 PM: - netlify-plugin-algolia-index@0.3.0
2:44:58 PM: - netlify-plugin-amp-server-side-rendering@1.0.2
2:44:58 PM: - netlify-plugin-brand-guardian@1.0.1
2:44:58 PM: - netlify-plugin-build-logger@1.0.3
2:44:58 PM: - netlify-plugin-bundle-env@0.2.2
2:44:58 PM: - netlify-plugin-cache-nextjs@1.4.0
2:44:58 PM: - netlify-plugin-cecil-cache@0.3.3
2:44:58 PM: - netlify-plugin-checklinks@4.1.1
2:44:58 PM: - netlify-plugin-chromium@1.1.4
2:44:58 PM: - netlify-plugin-cloudinary@1.0.3
2:44:58 PM: - netlify-plugin-contextual-env@0.3.0
2:44:58 PM: - netlify-plugin-cypress@2.2.0
2:44:58 PM: - netlify-plugin-debug-cache@1.0.4
2:44:58 PM: - netlify-plugin-encrypted-files@0.0.5
2:44:58 PM: - netlify-plugin-fetch-feeds@0.2.3
2:44:58 PM: - netlify-plugin-flutter@1.1.0
2:44:58 PM: - netlify-plugin-formspree@1.0.1
2:44:58 PM: - netlify-plugin-gatsby-cache@0.3.0
2:44:58 PM: - netlify-plugin-get-env-vars@1.0.0
2:44:58 PM: - netlify-plugin-ghost-inspector@1.0.1
2:44:58 PM: - netlify-plugin-ghost-markdown@3.1.0
2:44:58 PM: - netlify-plugin-gmail@1.1.0
2:44:58 PM: - netlify-plugin-gridsome-cache@1.0.3
2:44:58 PM: - netlify-plugin-hashfiles@4.0.2
2:44:58 PM: - netlify-plugin-html-validate@1.0.0
2:44:58 PM: - netlify-plugin-hugo-cache-resources@0.2.1
2:44:58 PM: - netlify-plugin-image-optim@0.4.0
2:44:58 PM: - netlify-plugin-inline-critical-css@2.0.0
2:44:58 PM: - netlify-plugin-inline-functions-env@1.0.8
2:44:58 PM: - netlify-plugin-inline-source@1.0.4
2:44:58 PM: - netlify-plugin-inngest@1.0.0
2:44:58 PM: - netlify-plugin-is-website-vulnerable@2.0.3
2:44:58 PM: - netlify-plugin-jekyll-cache@1.0.0
2:44:58 PM: - netlify-plugin-js-obfuscator@1.0.20
2:44:58 PM: - netlify-plugin-minify-html@0.3.1
2:44:58 PM: - netlify-plugin-next-dynamic@1.0.9
2:44:58 PM: - netlify-plugin-nimbella@2.1.0
2:44:58 PM: - netlify-plugin-no-more-404@0.0.15
2:44:58 PM: - netlify-plugin-nx-skip-build@0.0.7
2:44:58 PM: - netlify-plugin-pagewatch@1.0.4
2:44:58 PM: - netlify-plugin-playwright-cache@0.0.1
2:44:58 PM: - netlify-plugin-prerender-spa@1.0.1
2:44:58 PM: - netlify-plugin-prisma-provider@0.3.0
2:44:58 PM: - netlify-plugin-pushover@0.1.1
2:44:58 PM: - netlify-plugin-qawolf@1.2.0
2:44:58 PM: - netlify-plugin-rss@0.0.8
2:44:58 PM: - netlify-plugin-search-index@0.1.5
2:44:58 PM: - netlify-plugin-snyk@1.2.0
2:44:58 PM: - netlify-plugin-stepzen@1.0.4
2:44:58 PM: - netlify-plugin-subfont@6.0.0
2:44:58 PM: - netlify-plugin-submit-sitemap@0.4.0
2:44:58 PM: - netlify-plugin-to-all-events@1.3.1
2:44:58 PM: - netlify-plugin-use-env-in-runtime@1.2.1
2:44:58 PM: - netlify-plugin-visual-diff@2.0.0
2:44:58 PM: - netlify-plugin-webmentions@1.1.0
2:44:58 PM: - netlify-purge-cloudflare-on-deploy@1.2.0
2:44:58 PM:
2:44:58 PM: ❯ Installing plugins
2:44:58 PM: - @netlify/plugin-gatsby@3.6.2
2:45:10 PM:
2:45:10 PM: ❯ Loading plugins
2:45:10 PM: - @netlify/plugin-gatsby@3.6.2 from Netlify app (latest 3.6.2, expected 3.6.2, compatible 3.6.2)
2:45:11 PM:
2:45:11 PM: Plugin "@netlify/plugin-gatsby" internal error
2:45:11 PM: ────────────────────────────────────────────────────────────────
2:45:11 PM:
2:45:11 PM: Error message
2:45:11 PM: Could not import plugin:
2:45:11 PM: Error: Cannot find module 'common-tags'
2:45:11 PM: Require stack:
2:45:11 PM: - /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/index.js
2:45:11 PM:
2:45:11 PM: Plugin details
2:45:11 PM: Package: @netlify/plugin-gatsby
2:45:11 PM: Version: 3.6.2
2:45:11 PM: Repository: git+https://github.com/netlify/netlify-plugin-gatsby.git
2:45:11 PM: npm link: https://www.npmjs.com/package/@netlify/plugin-gatsby
2:45:11 PM: Report issues: https://github.com/netlify/netlify-plugin-gatsby/issues
2:45:11 PM:
2:45:11 PM: Error location
2:45:11 PM: While loading "@netlify/plugin-gatsby" from Netlify app
2:45:11 PM: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
2:45:11 PM: at Function.Module._load (node:internal/modules/cjs/loader:871:27)
2:45:11 PM: at Module.require (node:internal/modules/cjs/loader:1098:19)
2:45:11 PM: at require (node:internal/modules/cjs/helpers:108:18)
2:45:11 PM: at Object.<anonymous> (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/index.js:10:23)
2:45:11 PM: at Module._compile (node:internal/modules/cjs/loader:1196:14)
2:45:11 PM: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
2:45:11 PM: at Module.load (node:internal/modules/cjs/loader:1074:32)
2:45:11 PM: at Function.Module._load (node:internal/modules/cjs/loader:909:12)
2:45:11 PM: at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
2:45:11 PM:
2:45:11 PM: Error properties
2:45:11 PM: { code: 'MODULE_NOT_FOUND' }
2:45:11 PM:
2:45:11 PM: Resolved config
2:45:11 PM: build:
2:45:11 PM: base: /opt/build/repo
2:45:11 PM: command: npm run build-web
2:45:11 PM: commandOrigin: ui
2:45:11 PM: environment:
2:45:11 PM: - MAILCHIMP_API_KEY
2:45:11 PM: - NETLIFY_BUILD_DEBUG
2:45:11 PM: - SANITY_DEPLOY_STUDIO_TOKEN
2:45:11 PM: publish: /opt/build/repo/web/public
2:45:11 PM: publishOrigin: ui
2:45:11 PM: functionsDirectory: /opt/build/repo/web/functions
2:45:13 PM: Failed during stage 'building site': Build script returned non-zero exit code: 3 (https://ntl.fyi/exit-code-3)
2:45:11 PM: plugins:
2:45:11 PM: - inputs: {}
2:45:11 PM: origin: ui
2:45:11 PM: package: '@netlify/plugin-gatsby'
2:45:12 PM: Caching artifacts
2:45:12 PM: Started saving node modules
2:45:12 PM: Finished saving node modules
2:45:12 PM: Started saving build plugins
2:45:12 PM: Finished saving build plugins
2:45:12 PM: Started saving corepack cache
2:45:12 PM: Finished saving corepack cache
2:45:12 PM: Started saving pip cache
2:45:12 PM: Finished saving pip cache
2:45:12 PM: Started saving emacs cask dependencies
2:45:12 PM: Finished saving emacs cask dependencies
2:45:12 PM: Started saving maven dependencies
2:45:12 PM: Finished saving maven dependencies
2:45:12 PM: Started saving boot dependencies
2:45:12 PM: Finished saving boot dependencies
2:45:12 PM: Started saving rust rustup cache
2:45:12 PM: Finished saving rust rustup cache
2:45:12 PM: Started saving go dependencies
2:45:12 PM: Finished saving go dependencies
2:45:13 PM: Cached Ruby version 2.7.1
2:45:13 PM: Build failed due to a plugin error: Build script returned non-zero exit code: 3
2:45:13 PM: Failing build: Failed to build site
2:45:13 PM: Finished processing build request in 1m35.09s
Function logs
Function logs
# Paste logs here
Confirmed that moving to Node v14.21.3 (lts / fermium) does not change this outcome or affect the build in any way.
Thanks for raising the issue @MAU-Estate.
Are you using a monorepo?
I noticed we had a similar issue here which relates to yarn2
or pnpm
: #549