Error running command: Build script returned non-zero exit code: 1 -

Hi guys,
I can’t deploy my gridsome. What’s wrong?
Here my log
12:51:07 AM: Create GraphQL schema - 0.44s
12:51:07 AM: Create pages and templates - 0.11s
12:51:07 AM: Generate code - 0.04s
12:51:07 AM: Bootstrap finish - 19.33s
12:51:08 AM: Execute GraphQL (415 queries) - 1.13s
12:51:09 AM: Write page data (420 files) - 0.18s
12:51:09 AM: Compiling assets…
12:51:35 AM: Compile assets - 26.78s
12:51:37 AM: Failed to render /tag/house-in-sicily
12:51:37 AM: ReferenceError: document is not defined
12:51:37 AM: at Module. (src/layouts/Default.vue:53:0)
12:51:37 AM: at webpack_require (webpack/bootstrap:25:0)
12:51:37 AM: at Module. (node_modules/gridsome/app/main.js:4:9)
12:51:37 AM: at webpack_require (webpack/bootstrap:25:0)
12:51:37 AM: at Object. (assets/js/app.13181aef.js:20080:18)
12:51:37 AM: at webpack_require (webpack/bootstrap:25:0)
12:51:37 AM: at assets/js/app.13181aef.js:118:18
12:51:37 AM: at Object. (assets/js/app.13181aef.js:121:10)
12:51:37 AM: at o (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:77545)
12:51:37 AM: at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:78138
12:51:37 AM: Failed to render /404
12:51:37 AM: Skipping functions preparation step: no functions directory set
12:51:37 AM: Caching artifacts
12:51:37 AM: Started saving node modules
12:51:37 AM: Finished saving node modules
12:51:37 AM: Started saving yarn cache
12:51:37 AM: Finished saving yarn cache
12:51:37 AM: Started saving pip cache
12:51:37 AM: Finished saving pip cache
12:51:37 AM: Started saving emacs cask dependencies
12:51:37 AM: Finished saving emacs cask dependencies
12:51:37 AM: Started saving maven dependencies
12:51:37 AM: Finished saving maven dependencies
12:51:37 AM: Started saving boot dependencies
12:51:38 AM: Finished saving boot dependencies
12:51:38 AM: Started saving go dependencies
12:51:38 AM: Finished saving go dependencies
12:51:38 AM: Error running command: Build script returned non-zero exit code: 1
12:51:38 AM: Failing build: Failed to build site
12:51:38 AM: failed during stage ‘building site’: Build script returned non-zero exit code: 1
12:51:38 AM: Finished processing build request in 1m16.604580065s

Thanks

It looks like the reason your deploy is failing is the following:

It looks like your code is using ‘document’ but that’s typically only available in a browser. You’ll need to look into fixing that. Hope that helps.