oleeskild / digitalgarden

301 stars 163 forks source link

Deploy failed after merge 1.26.0 #32

Closed hxhc closed 1 year ago

hxhc commented 1 year ago

Hi, I just update the template to 1.26.0, but Netlify and vercel both failed to deploy.

Obsidian version: 1.1.9 Digital Garden version: 2.30.0 The error messages are:

Netlify

4:12:28 PM:   Netlify Build                                                 
4:12:28 PM: ────────────────────────────────────────────────────────────────
4:12:28 PM: ​
4:12:28 PM: ❯ Version
4:12:28 PM:   @netlify/build 29.4.0
4:12:28 PM: ​
4:12:28 PM: ❯ Flags
4:12:28 PM:   baseRelDir: true
4:12:28 PM:   buildId: 63b7d7d6c32b730007022d32
4:12:28 PM:   deployId: 63b7d7d6c32b730007022d34
4:12:28 PM: ​
4:12:28 PM: ❯ Current directory
4:12:28 PM:   /opt/build/repo
4:12:28 PM: ​
4:12:28 PM: ❯ Config file
4:12:28 PM:   /opt/build/repo/netlify.toml
4:12:28 PM: ​
4:12:28 PM: ❯ Context
4:12:28 PM:   production
4:12:28 PM: ​
4:12:28 PM:   1. build.command from netlify.toml                            
4:12:28 PM: ────────────────────────────────────────────────────────────────
4:12:28 PM: ​
4:12:28 PM: $ npm install && npm run build
4:12:29 PM: up to date, audited 606 packages in 1s
4:12:29 PM: 72 packages are looking for funding
4:12:29 PM:   run `npm fund` for details
4:12:29 PM: 12 vulnerabilities (6 moderate, 5 high, 1 critical)
4:12:29 PM: To address issues that do not require attention, run:
4:12:29 PM:   npm audit fix
4:12:29 PM: Some issues need review, and may require choosing
4:12:29 PM: a different dependency.
4:12:29 PM: Run `npm audit` for details.
4:12:30 PM: > web@1.0.0 build
4:12:30 PM: > npm-run-all build:*
4:12:30 PM: > web@1.0.0 build:eleventy
4:12:30 PM: > cross-env ELEVENTY_ENV=prod NODE_OPTIONS=--max-old-space-size=4096 eleventy
4:12:31 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output)
4:12:31 PM: [11ty] Cannot find module '../helpers/linkUtils'
4:12:31 PM: [11ty] Require stack:
4:12:31 PM: [11ty] - /opt/build/repo/src/site/index.11tydata.js
4:12:31 PM: [11ty] - /opt/build/repo/node_modules/@11ty/eleventy/src/TemplateData.js
4:12:31 PM: [11ty] - /opt/build/repo/node_modules/@11ty/eleventy/src/Eleventy.js
4:12:31 PM: [11ty] - /opt/build/repo/node_modules/@11ty/eleventy/cmd.js (via Error)
4:12:31 PM: [11ty]
4:12:31 PM: [11ty] Original error stack trace: Error: Cannot find module '../helpers/linkUtils'
4:12:31 PM: [11ty] Require stack:
4:12:31 PM: [11ty] - /opt/build/repo/src/site/index.11tydata.js
4:12:31 PM: [11ty] - /opt/build/repo/node_modules/@11ty/eleventy/src/TemplateData.js
4:12:31 PM: [11ty] - /opt/build/repo/node_modules/@11ty/eleventy/src/Eleventy.js
4:12:31 PM: [11ty] - /opt/build/repo/node_modules/@11ty/eleventy/cmd.js
4:12:31 PM: [11ty]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
4:12:31 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
4:12:31 PM: [11ty]     at Function.Module._load (node:internal/modules/cjs/loader:841:27)
4:12:31 PM: [11ty]     at Module.require (node:internal/modules/cjs/loader:1067:19)
4:12:31 PM: [11ty]     at require (node:internal/modules/cjs/helpers:103:18)
4:12:31 PM: [11ty]     at Object.<anonymous> (/opt/build/repo/src/site/index.11tydata.js:6:44)
4:12:31 PM: [11ty]     at Module._compile (node:internal/modules/cjs/loader:1165:14)
4:12:31 PM: [11ty]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
4:12:31 PM: [11ty]     at Module.load (node:internal/modules/cjs/loader:1043:32)
4:12:31 PM: [11ty]     at Function.Module._load (node:internal/modules/cjs/loader:878:12)
4:12:31 PM: [11ty]     at Module.require (node:internal/modules/cjs/loader:1067:19)
4:12:31 PM: [11ty] Benchmark    174ms  36%     1× (Data) `./src/site/_data/meta.js`
4:12:31 PM: [11ty] Wrote 0 files in 0.25 seconds (v1.0.2)
4:12:31 PM: ERROR: "build:eleventy" exited with 1.
4:12:31 PM: ​
4:12:31 PM:   "build.command" failed                                        
4:12:31 PM: ────────────────────────────────────────────────────────────────
4:12:31 PM: ​
4:12:31 PM:   Error message
4:12:31 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
4:12:31 PM: ​
4:12:31 PM:   Error location
4:12:31 PM:   In build.command from netlify.toml:
4:12:31 PM:   npm install && npm run build
4:12:31 PM: ​
4:12:31 PM:   Resolved config
4:12:31 PM:   build:
4:12:31 PM:     command: npm install && npm run build
4:12:31 PM:     commandOrigin: config
4:12:31 PM:     publish: /opt/build/repo/dist
4:12:31 PM:     publishOrigin: config
4:12:31 PM:   functionsDirectory: /opt/build/repo/netlify/functions
4:12:31 PM:   redirects:
4:12:31 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts
4:12:31 PM: Started saving node modules
4:12:31 PM: Finished saving node modules
4:12:31 PM: Started saving build plugins
4:12:31 PM: Finished saving build plugins
4:12:31 PM: Started saving pip cache
4:12:31 PM: Finished saving pip cache
4:12:31 PM: Started saving emacs cask dependencies
4:12:31 PM: Finished saving emacs cask dependencies
4:12:31 PM: Started saving maven dependencies
4:12:31 PM: Finished saving maven dependencies
4:12:31 PM: Started saving boot dependencies
4:12:31 PM: Finished saving boot dependencies
4:12:31 PM: Started saving rust rustup cache
4:12:31 PM: Finished saving rust rustup cache
4:12:31 PM: Started saving go dependencies
4:12:31 PM: Finished saving go dependencies
4:12:31 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:12:31 PM: Failing build: Failed to build site
4:12:31 PM: Finished processing build request in 20.690229452s

vercel

<html>
<body>
<!--StartFragment-->

> web@1.0.0 build:eleventy
--
16:12:17.718 | > cross-env ELEVENTY_ENV=prod NODE_OPTIONS=--max-old-space-size=4096 eleventy
16:12:17.718 |  
16:12:18.797 | [11ty] Problem writing Eleventy templates: (more in DEBUG output)
16:12:18.798 | [11ty] Cannot find module '../helpers/linkUtils'
16:12:18.798 | [11ty] Require stack:
16:12:18.798 | [11ty] - /vercel/path0/src/site/index.11tydata.js
16:12:18.799 | [11ty] - /vercel/path0/node_modules/@11ty/eleventy/src/TemplateData.js
16:12:18.799 | [11ty] - /vercel/path0/node_modules/@11ty/eleventy/src/Eleventy.js
16:12:18.799 | [11ty] - /vercel/path0/node_modules/@11ty/eleventy/cmd.js (via Error)
16:12:18.799 | [11ty]
16:12:18.800 | [11ty] Original error stack trace: Error: Cannot find module '../helpers/linkUtils'
16:12:18.800 | [11ty] Require stack:
16:12:18.800 | [11ty] - /vercel/path0/src/site/index.11tydata.js
16:12:18.800 | [11ty] - /vercel/path0/node_modules/@11ty/eleventy/src/TemplateData.js
16:12:18.800 | [11ty] - /vercel/path0/node_modules/@11ty/eleventy/src/Eleventy.js
16:12:18.800 | [11ty] - /vercel/path0/node_modules/@11ty/eleventy/cmd.js
16:12:18.801 | [11ty]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
16:12:18.801 | [11ty]     at Function.Module._load (node:internal/modules/cjs/loader:833:27)
16:12:18.801 | [11ty]     at Module.require (node:internal/modules/cjs/loader:1057:19)
16:12:18.801 | [11ty]     at require (node:internal/modules/cjs/helpers:103:18)
16:12:18.801 | [11ty]     at Object.<anonymous> (/vercel/path0/src/site/index.11tydata.js:6:44)
16:12:18.802 | [11ty]     at Module._compile (node:internal/modules/cjs/loader:1155:14)
16:12:18.802 | [11ty]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
16:12:18.802 | [11ty]     at Module.load (node:internal/modules/cjs/loader:1033:32)
16:12:18.802 | [11ty]     at Function.Module._load (node:internal/modules/cjs/loader:868:12)
16:12:18.802 | [11ty]     at Module.require (node:internal/modules/cjs/loader:1057:19)
16:12:18.802 | [11ty] Benchmark    186ms  25%     1× (Data) `./src/site/_data/meta.js`
16:12:18.803 | [11ty] Wrote 0 files in 0.33 seconds (v1.0.2)
16:12:18.836 | ERROR: "build:eleventy" exited with 1.
16:12:18.861 | Error: Command "npm install && npm run build" exited with 1

<!--EndFragment-->
</body>
</html>

I am not sure whether it's my fault or the new template bugs. Hope you can give me some solutions, Thanks!

oleeskild commented 1 year ago

There was a new file added to the template. When this happens you need to update the plugin to the latest version first. Try doing that, then use the "Update template" button afterwards.

It is a bit clunky, and not very obvious from a user perspective, so I will change this in the future to not use a hardcoded list of files, and instead get the filelist from a central place.

hxhc commented 1 year ago

Thank you and the deployment failure has been solved. I updated the template first and upgraded the plugin later, which caused the problem. My bad indeed😂.