### Discussed in https://github.com/quarto-dev/quarto-cli/discussions/1953

<div type='discussions-op-text'>

<sup>Originally posted by **andrewpbray** August 17, 2022</sup>
I have a quarto website set up to publish on netlify from [github](https://github.com/stat20/website) via the [Quarto Netlify Build Plugin](https://quarto.org/docs/publishing/netlify.html#plugin-configuration). On my [most recent PR](https://github.com/stat20/website/pull/11), the [deploy preview](https://deploy-preview-11--cerulean-blancmange-29d7af.netlify.app/) worked just fine, but upon merge, the build failed on Netlify with "Failed due to plugin error".

Is this the right place to post such an error? I've looked on Netlify forums and solutions to this error seem often reside in a dependency of the plugin.

For reference, here's the error log from Netlify:

```
2:59:31 PM: Build ready to start
2:59:33 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
2:59:33 PM: build-image tag: v4.10.1
2:59:33 PM: buildbot version: 4cffa5dc84445a450e8be6f710e2498d87994fae
2:59:33 PM: Fetching cached dependencies
2:59:33 PM: Starting to download cache of 170.3MB
2:59:33 PM: Finished downloading cache in 472.330418ms
2:59:33 PM: Starting to extract cache
2:59:34 PM: Finished extracting cache in 669.245211ms
2:59:34 PM: Finished fetching cache in 1.190148942s
2:59:34 PM: Starting to prepare the repo for build
2:59:34 PM: Preparing Git Reference refs/heads/main
2:59:35 PM: Parsing package.json dependencies
2:59:36 PM: Starting build script
2:59:36 PM: Installing dependencies
2:59:36 PM: Python version set to 2.7
2:59:36 PM: Started restoring cached node version
2:59:37 PM: Finished restoring cached node version
2:59:37 PM: v16.17.0 is already installed.
2:59:37 PM: Now using node v16.17.0 (npm v8.15.0)
2:59:37 PM: Started restoring cached build plugins
2:59:37 PM: Finished restoring cached build plugins
2:59:37 PM: Attempting ruby version 2.7.2, read from environment
2:59:38 PM: Using ruby version 2.7.2
2:59:38 PM: Using PHP version 8.0
2:59:38 PM: No npm workspaces detected
2:59:38 PM: Started restoring cached node modules
2:59:38 PM: Finished restoring cached node modules
2:59:39 PM: Started restoring cached go cache
2:59:39 PM: Finished restoring cached go cache
2:59:39 PM: Installing Go version 1.17 (requested 1.17)
2:59:43 PM: unset GOOS;
2:59:43 PM: unset GOARCH;
2:59:43 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
2:59:43 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
2:59:43 PM: go version >&2;
2:59:43 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
2:59:43 PM: go version go1.17 linux/amd64
2:59:43 PM: Installing missing commands
2:59:43 PM: Verify run directory
2:59:44 PM: ​
2:59:44 PM: ────────────────────────────────────────────────────────────────
2:59:44 PM:   Netlify Build                                                 
2:59:44 PM: ────────────────────────────────────────────────────────────────
2:59:44 PM: ​
2:59:44 PM: ❯ Version
2:59:44 PM:   @netlify/build 27.11.5
2:59:44 PM: ​
2:59:44 PM: ❯ Flags
2:59:44 PM:   baseRelDir: true
2:59:44 PM:   buildId: 62fd64c32597ef0008438c7e
2:59:44 PM:   deployId: 62fd64c32597ef0008438c80
2:59:44 PM: ​
2:59:44 PM: ❯ Current directory
2:59:44 PM:   /opt/build/repo
2:59:44 PM: ​
2:59:44 PM: ❯ Config file
2:59:44 PM:   /opt/build/repo/netlify.toml
2:59:44 PM: ​
2:59:44 PM: ❯ Context
2:59:44 PM:   production
2:59:44 PM: ​
2:59:44 PM: ❯ Loading plugins
2:59:44 PM:    - @quarto/netlify-plugin-quarto@0.0.5 from netlify.toml and package.json
2:59:45 PM: ​
2:59:45 PM: ────────────────────────────────────────────────────────────────
2:59:45 PM:   1. @quarto/netlify-plugin-quarto (onPreBuild event)           
2:59:45 PM: ────────────────────────────────────────────────────────────────
2:59:45 PM: ​
2:59:45 PM: ​
2:59:45 PM: ────────────────────────────────────────────────────────────────
2:59:45 PM:   Plugin "@quarto/netlify-plugin-quarto" internal error         
2:59:45 PM: ────────────────────────────────────────────────────────────────
2:59:45 PM: ​
2:59:45 PM:   Error message
2:59:45 PM:   Error: function () { [native code] } could not be cloned.
2:59:45 PM: ​
2:59:45 PM:   Plugin details
2:59:45 PM:   Package:        @quarto/netlify-plugin-quarto
2:59:45 PM:   Version:        0.0.5
2:59:45 PM:   Repository:     git+https://github.com/quarto-dev/netlify-plugin-quarto.git
2:59:45 PM:   npm link:       https://www.npmjs.com/package/@quarto/netlify-plugin-quarto
2:59:45 PM:   Report issues:  https://github.com/quarto-dev/netlify-plugin-quarto/issues
2:59:45 PM: ​
2:59:45 PM:   Error location
2:59:45 PM:   In "onPreBuild" event in "@quarto/netlify-plugin-quarto" from netlify.toml and package.json
2:59:45 PM:       at writeChannelMessage (node:internal/child_process/serialization:109:9)
2:59:45 PM:       at process.target._send (node:internal/child_process:840:17)
2:59:45 PM:       at process.target.send (node:internal/child_process:740:19)
2:59:45 PM:       at node:internal/util:361:7
2:59:45 PM:       at new Promise (<anonymous>)
2:59:45 PM:       at bound  (node:internal/util:347:12)
2:59:45 PM:       at sendEventToParent (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/ipc.js:123:46)
2:59:45 PM:       at handleError (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/child/error.js:13:9)
2:59:45 PM:       at handleEvent (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/child/main.js:45:11)
2:59:45 PM:       at processTicksAndRejections (node:internal/process/task_queues:96:5)
2:59:45 PM: ​
2:59:45 PM:   Resolved config
2:59:45 PM:   build:
2:59:45 PM:     publish: /opt/build/repo/_site
2:59:45 PM:     publishOrigin: ui
2:59:45 PM:   plugins:
2:59:45 PM:     - inputs: {}
2:59:45 PM:       origin: config
2:59:45 PM:       package: '@quarto/netlify-plugin-quarto'
2:59:46 PM: Caching artifacts
2:59:46 PM: Started saving node modules
2:59:46 PM: Finished saving node modules
2:59:46 PM: Started saving build plugins
2:59:46 PM: Finished saving build plugins
2:59:46 PM: Started saving pip cache
2:59:46 PM: Finished saving pip cache
2:59:46 PM: Started saving emacs cask dependencies
2:59:46 PM: Finished saving emacs cask dependencies
2:59:46 PM: Started saving maven dependencies
2:59:46 PM: Finished saving maven dependencies
2:59:46 PM: Started saving boot dependencies
2:59:46 PM: Finished saving boot dependencies
2:59:46 PM: Started saving rust rustup cache
2:59:46 PM: Finished saving rust rustup cache
2:59:46 PM: Started saving go dependencies
2:59:46 PM: Finished saving go dependencies
2:59:46 PM: Build failed due to a plugin error: Build script returned non-zero exit code: 3
2:59:46 PM: Creating deploy upload records
2:59:46 PM: Failing build: Failed to build site
2:59:46 PM: Failed during stage 'building site': Build script returned non-zero exit code: 3 (https://ntl.fyi/exit-code-3)
2:59:46 PM: Finished processing build request in 13.421019233s
```</div>
2022-08-18T10:42:57Z
jjallaire
closed
Plugin "@quarto/netlify-plugin-quarto" internal error
https://github.com/quarto-dev/quarto-cli/issues/1961