question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploy failed due to an error in @netlify/plugin-functions-core plugin

See original GitHub issue

When I try deploying a react app with serverless functions, I keep getting this plugin error:

7:41:20 PM: Build ready to start
7:41:21 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
7:41:21 PM: build-image tag: v3.4.1
7:41:21 PM: buildbot version: 648208d76731cd5bca75c1e9bc99d2032a1f1473
7:41:22 PM: Fetching cached dependencies
7:41:22 PM: Failed to fetch cache, continuing with build
7:41:22 PM: Starting to prepare the repo for build
7:41:22 PM: No cached dependencies found. Cloning fresh repo
7:41:22 PM: git clone https://github.com/mikeattara/rxn
7:41:23 PM: Preparing Git Reference refs/heads/master
7:41:24 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'functions' versus '' in the Netlify UI
7:41:24 PM: Starting build script
7:41:24 PM: Installing dependencies
7:41:24 PM: Python version set to 2.7
7:41:25 PM: v12.18.0 is already installed.
7:41:26 PM: Now using node v12.18.0 (npm v6.14.4)
7:41:26 PM: Started restoring cached build plugins
7:41:26 PM: Finished restoring cached build plugins
7:41:26 PM: Attempting ruby version 2.7.1, read from environment
7:41:27 PM: Using ruby version 2.7.1
7:41:28 PM: Using PHP version 5.6
7:41:28 PM: 5.2 is already installed.
7:41:28 PM: Using Swift version 5.2
7:41:28 PM: Started restoring cached node modules
7:41:28 PM: Finished restoring cached node modules
7:41:28 PM: Installing NPM modules using NPM version 6.14.4
7:42:03 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
7:42:03 PM: > node -e "try{require('./postinstall')}catch(e){}"
7:42:03 PM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js
7:42:03 PM: > node -e "try{require('./postinstall')}catch(e){}"
7:42:03 PM: > core-js-pure@3.6.5 postinstall /opt/build/repo/node_modules/core-js-pure
7:42:03 PM: > node -e "try{require('./postinstall')}catch(e){}"
7:42:06 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
7:42:06 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:42:06 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
7:42:06 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:42:06 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
7:42:06 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:42:06 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
7:42:06 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:42:06 PM: added 1700 packages from 781 contributors and audited 1707 packages in 37.106s
7:42:08 PM: 74 packages are looking for funding
7:42:08 PM:   run `npm fund` for details
7:42:08 PM: found 0 vulnerabilities
7:42:08 PM: NPM modules installed
7:42:08 PM: Started restoring cached go cache
7:42:08 PM: Finished restoring cached go cache
7:42:08 PM: go version go1.14.4 linux/amd64
7:42:08 PM: go version go1.14.4 linux/amd64
7:42:08 PM: Installing missing commands
7:42:08 PM: Verify run directory
7:42:10 PM: ​
7:42:10 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
7:42:10 PM: β”‚        Netlify Build        β”‚
7:42:10 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
7:42:10 PM: ​
7:42:10 PM: ❯ Version
7:42:10 PM:   @netlify/build 4.0.4
7:42:10 PM: ​
7:42:10 PM: ❯ Flags
7:42:10 PM:   deployId: 5f67b0606b71be00088a4b07
7:42:10 PM:   mode: buildbot
7:42:10 PM: ​
7:42:10 PM: ❯ Current directory
7:42:10 PM:   /opt/build/repo
7:42:10 PM: ​
7:42:10 PM: ❯ Config file
7:42:10 PM:   /opt/build/repo/netlify.toml
7:42:10 PM: ​
7:42:10 PM: ❯ Context
7:42:10 PM:   production
7:42:11 PM: ​
7:42:11 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
7:42:11 PM: β”‚ 1. build.command from netlify.toml β”‚
7:42:11 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
7:42:11 PM: ​
7:42:11 PM: $ npm run build
7:42:12 PM: > rxn@0.1.0 build /opt/build/repo
7:42:12 PM: > npm-run-all --parallel build:**
7:42:12 PM: > rxn@0.1.0 build:functions /opt/build/repo
7:42:12 PM: > netlify-lambda build src/functions
7:42:12 PM: > rxn@0.1.0 build:app /opt/build/repo
7:42:12 PM: > react-scripts build
7:42:13 PM: netlify-lambda: Building functions
7:42:14 PM: Creating an optimized production build...
7:42:19 PM: Hash: 9a795d48acb577996021
7:42:19 PM: Version: webpack 4.44.2
7:42:19 PM: Time: 5414ms
7:42:19 PM: Built at: 09/20/2020 7:42:19 PM
7:42:19 PM:          Asset      Size  Chunks             Chunk Names
7:42:19 PM:   get-posts.js  62.4 KiB       0  [emitted]  get-posts
7:42:19 PM: update-post.js  61.5 KiB       1  [emitted]  update-post
7:42:19 PM: Entrypoint get-posts = get-posts.js
7:42:19 PM: Entrypoint update-post = update-post.js
7:42:19 PM:  [2] ../utils/db.js 230 bytes {0} {1} [built]
7:42:19 PM:  [3] /opt/build/repo/node_modules/faunadb/src/errors.js 6.25 KiB {0} {1} [built]
7:42:19 PM:  [4] /opt/build/repo/node_modules/faunadb/src/values.js 8.85 KiB {0} {1} [built]
7:42:19 PM:  [5] external "http" 42 bytes {0} {1} [built]
7:42:19 PM:  [7] external "util" 42 bytes {0} {1} [built]
7:42:19 PM:  [8] /opt/build/repo/node_modules/faunadb/src/query.js 87.7 KiB {0} {1} [built]
7:42:19 PM:  [9] /opt/build/repo/node_modules/faunadb/src/Expr.js 7.25 KiB {0} {1} [built]
7:42:19 PM: [10] /opt/build/repo/node_modules/faunadb/src/_util.js 1.67 KiB {0} {1} [built]
7:42:19 PM: [12] /opt/build/repo/node_modules/faunadb/index.js 330 bytes {0} {1} [built]
7:42:19 PM: [16] /opt/build/repo/node_modules/faunadb/src/RequestResult.js 2.32 KiB {0} {1} [built]
7:42:19 PM: [17] /opt/build/repo/node_modules/faunadb/src/PageHelper.js 6.87 KiB {0} {1} [built]
7:42:19 PM: [18] /opt/build/repo/node_modules/faunadb/src/Client.js 8.28 KiB {0} {1} [built]
7:42:19 PM: [27] /opt/build/repo/node_modules/faunadb/src/clientLogger.js 2.74 KiB {0} {1} [built]
7:42:19 PM: [28] ./get-posts.js 1.84 KiB {0} [built]
7:42:19 PM: [29] ./update-post.js 304 bytes {1} [built]
7:42:19 PM:     + 15 hidden modules
7:42:28 PM: Compiled successfully.
7:42:28 PM: 
7:42:28 PM: File sizes after gzip:
7:42:28 PM:   54.82 KB  build/static/js/2.425ba201.chunk.js
7:42:28 PM:   793 B     build/static/js/main.dd046fbe.chunk.js
7:42:28 PM:   769 B     build/static/js/runtime-main.8deeb446.js
7:42:28 PM: The project was built assuming it is hosted at /.
7:42:28 PM: You can control this with the homepage field in your package.json.
7:42:28 PM: The build folder is ready to be deployed.
7:42:28 PM: You may serve it with a static server:
7:42:28 PM:   npm install -g serve
7:42:28 PM:   serve -s build
7:42:28 PM: Find out more about deployment here:
7:42:28 PM:   bit.ly/CRA-deploy
7:42:28 PM: ​
7:42:28 PM: (build.command completed in 16.2s)
7:42:28 PM: ​
7:42:28 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
7:42:28 PM: β”‚ 2. onPostBuild command from @netlify/plugin-functions-core β”‚
7:42:28 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
7:42:28 PM: ​
7:42:28 PM: Packaging Functions from functions directory:
7:42:28 PM:  - get-posts.js
7:42:28 PM:  - update-post.js
7:42:29 PM: ​
7:42:29 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
7:42:29 PM: β”‚ Plugin "@netlify/plugin-functions-core" internal error β”‚
7:42:29 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
7:42:29 PM: ​
7:42:29 PM:   Error message
7:42:29 PM:   Error: In file "/opt/build/repo/functions/get-posts.js": Cannot find module 'encoding'
7:42:29 PM:   Require stack:
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/resolve.js
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/dependencies.js
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/main.js
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/plugin.js
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/logic.js
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/load.js
7:42:29 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/main.js
7:42:29 PM: ​
7:42:29 PM:   Plugin details
7:42:29 PM:   Package:        @netlify/plugin-functions-core
7:42:29 PM:   Version:        4.0.4
7:42:29 PM:   Repository:     git+https://github.com/netlify/build.git
7:42:29 PM:   npm link:       https://www.npmjs.com/package/@netlify/build
7:42:29 PM:   Report issues:  https://github.com/netlify/build/issues
7:42:29 PM: ​
7:42:29 PM:   Error location
7:42:29 PM:   In "onPostBuild" event in "@netlify/plugin-functions-core" from core
7:42:29 PM:       at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
7:42:29 PM:       at Function.resolve (internal/modules/cjs/helpers.js:83:19)
7:42:29 PM:       at resolvePathFollowSymlinks (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/resolve.js:62:18)
7:42:29 PM:       at resolvePackageFallback (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/resolve.js:74:24)
7:42:29 PM:       at resolvePackage (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/resolve.js:33:27)
7:42:29 PM: ​
7:42:29 PM:   Error properties
7:42:29 PM:   { code: 'MODULE_NOT_FOUND' }
7:42:29 PM: ​
7:42:29 PM:   Resolved config
7:42:29 PM:   build:
7:42:29 PM:     command: npm run build
7:42:29 PM:     commandOrigin: config
7:42:29 PM:     functions: /opt/build/repo/functions
7:42:29 PM:     publish: /opt/build/repo/build
7:42:29 PM:   plugins:
7:42:29 PM:     - inputs: {}
7:42:29 PM:       origin: config
7:42:29 PM:       package: '@netlify/plugin-functions-core'
7:42:29 PM: Caching artifacts
7:42:29 PM: Started saving node modules
7:42:29 PM: Finished saving node modules
7:42:29 PM: Started saving build plugins
7:42:29 PM: Finished saving build plugins
7:42:29 PM: Started saving pip cache
7:42:29 PM: Finished saving pip cache
7:42:29 PM: Started saving emacs cask dependencies
7:42:29 PM: Finished saving emacs cask dependencies
7:42:29 PM: Started saving maven dependencies
7:42:29 PM: Finished saving maven dependencies
7:42:29 PM: Started saving boot dependencies
7:42:29 PM: Finished saving boot dependencies
7:42:29 PM: Started saving go dependencies
7:42:29 PM: Finished saving go dependencies
7:42:32 PM: Error running command: Build script returned non-zero exit code: 3
7:42:32 PM: Failing build: Failed to build site
7:42:32 PM: Failed during stage 'building site': Build script returned non-zero exit code: 3
7:42:32 PM: Finished processing build request in 1m10.568943318s

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kijanawoodardcommented, Jan 24, 2021

@ehmicky i don’t have a repository for you, but, if it helps, i ran into this right after adding firebase-admin to my project and using it in a function.

i used the β€œadd encoding to my project” workaround. 😦

1reaction
erezrokahcommented, Jan 22, 2021

@mannycolon you specific error is tracked here https://github.com/netlify/build/issues/2193

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploy failed due to an error in @netlify/plugin-functions-core ...
highly annoying. Works super on my local, but can't deploy. This function it complains of used to get build two months ago until...
Read more >
Deploy failed due to an error in @netlify/plugin-functions-core ...
I am new to TypeScript, Netlify, and RedwoodJS. Yesterday I ran into a lot of problems trying to deploy what I thought was...
Read more >
Cannot deploy Next.js to Netlify. Deploy failed due to an error ...
Disabling the plugin broke my site temporarily because it's needed to run Next.js, but it was the only way I could get my...
Read more >
Netlify CMS & Next.js Deploy Error Fixed. (failed due to an ...
THE ERROR : Site has not yet been deployedfailed due to an error in @netlify/ plugin -nextjs pluginDeploy summaryPluginΒ ...
Read more >
Recently, deployments of Mule 3 apps with Mule Maven ...
SYMPTOM. Deploying a Mule application with Mule Maven Plugin version 2.2.x/3.1.x fails with the error below: [ERROR] Failed to execute goalΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found