oleeskild / obsidian-digital-garden

MIT License
1.36k stars 125 forks source link

Deployment failed both at Vercel and Netlify #288

Open ghost opened 1 year ago

ghost commented 1 year ago

All was fine until recently I am unable to deploy anything either on Netlify or Vercel.

I have tried deleting and re-installing Digital Garden in Obsidian, updating the template in the plug-in, deleting all projects on Netlify, Vercel, and Github, and recreating new projects, but it still doesn't work.

I am not a tech person so I don't know how to read the error message and solve the problem.

On Netlify, it says non-zero exit status: 2. 9:31:42 PM: build-image version: 68a2c262fa3c95a08a1716b8dde8fba0e332ec73 (focal) 9:31:42 PM: buildbot version: 68a2c262fa3c95a08a1716b8dde8fba0e332ec73 9:31:42 PM: Fetching cached dependencies 9:31:42 PM: Starting to download cache of 104.0MB 9:31:43 PM: Finished downloading cache in 334ms 9:31:43 PM: Starting to extract cache 9:31:43 PM: Finished extracting cache in 775ms 9:31:43 PM: Finished fetching cache in 1.169s 9:31:43 PM: Starting to prepare the repo for build 9:31:44 PM: Preparing Git Reference refs/heads/main 9:31:45 PM: Parsing package.json dependencies 9:31:46 PM: Starting to install dependencies 9:31:46 PM: Python version set to 3.8 9:31:46 PM: Attempting Ruby version 2.7.2, read from environment 9:31:47 PM: Using Ruby version 2.7.2 9:31:47 PM: Started restoring cached go cache 9:31:47 PM: Finished restoring cached go cache 9:31:47 PM: Installing Go version 1.19.5 (requested 1.19.5) 9:31:53 PM: go version go1.19.5 linux/amd64 9:31:53 PM: Using PHP version 8.0 9:31:54 PM: Started restoring cached Node.js version 9:31:54 PM: Finished restoring cached Node.js version 9:31:55 PM: v16.20.0 is already installed. 9:31:55 PM: Now using node v16.20.0 (npm v8.19.4) 9:31:55 PM: Enabling Node.js Corepack 9:31:55 PM: Started restoring cached build plugins 9:31:55 PM: Finished restoring cached build plugins 9:31:55 PM: Started restoring cached corepack dependencies 9:31:55 PM: Finished restoring cached corepack dependencies 9:31:55 PM: No npm workspaces detected 9:31:55 PM: Started restoring cached node modules 9:31:55 PM: Finished restoring cached node modules 9:31:55 PM: Installing npm packages using npm version 8.19.4 9:31:58 PM: up to date, audited 555 packages in 2s 9:31:58 PM: 98 packages are looking for funding 9:31:58 PM: run npm fund for details 9:31:58 PM: 14 vulnerabilities (2 moderate, 9 high, 3 critical) 9:31:58 PM: To address issues that do not require attention, run: 9:31:58 PM: npm audit fix 9:31:58 PM: Some issues need review, and may require choosing 9:31:58 PM: a different dependency. 9:31:58 PM: Run npm audit for details. 9:31:58 PM: npm packages installed 9:31:58 PM: Install dependencies script success 9:31:58 PM: Starting build script 9:31:59 PM: Detected 1 framework(s) 9:31:59 PM: "eleventy" at version "2.0.1" 9:31:59 PM: Section completed: initializing 9:32:00 PM: ​ 9:32:00 PM: Netlify Build
9:32:00 PM: ──────────────────────────────────────────────────────────────── 9:32:00 PM: ​ 9:32:00 PM: ❯ Version 9:32:00 PM: @netlify/build 29.9.2 9:32:00 PM: ​ 9:32:00 PM: ❯ Flags 9:32:00 PM: baseRelDir: true 9:32:00 PM: buildId: 64473b8a0aa74600080d0693 9:32:00 PM: deployId: 64473b8a0aa74600080d0695 9:32:00 PM: ​ 9:32:00 PM: ❯ Current directory 9:32:00 PM: /opt/build/repo 9:32:00 PM: ​ 9:32:00 PM: ❯ Config file 9:32:00 PM: /opt/build/repo/netlify.toml 9:32:00 PM: ​ 9:32:00 PM: ❯ Context 9:32:00 PM: production 9:32:00 PM: ​ 9:32:00 PM: 1. build.command from netlify.toml
9:32:00 PM: ──────────────────────────────────────────────────────────────── 9:32:00 PM: ​ 9:32:00 PM: $ npm install && npm run build 9:32:01 PM: up to date, audited 555 packages in 793ms 9:32:01 PM: 98 packages are looking for funding 9:32:01 PM: run npm fund for details 9:32:01 PM: 14 vulnerabilities (2 moderate, 9 high, 3 critical) 9:32:01 PM: To address issues that do not require attention, run: 9:32:01 PM: npm audit fix 9:32:01 PM: Some issues need review, and may require choosing 9:32:01 PM: a different dependency. 9:32:01 PM: Run npm audit for details. 9:32:02 PM: > web@1.0.0 build 9:32:02 PM: > npm-run-all get-theme build: 9:32:02 PM: > web@1.0.0 get-theme 9:32:02 PM: > node src/site/get-theme.js 9:32:02 PM: > web@1.0.0 build:eleventy 9:32:02 PM: > cross-env ELEVENTY_ENV=prod NODE_OPTIONS=--max-old-space-size=4096 eleventy 9:32:03 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output) 9:32:03 PM: [11ty] 1. Having trouble rendering njk template ./src/site/notes/xxx/xxx.md (via TemplateContentRenderError) 9:32:03 PM: [11ty] 2. Cannot read properties of undefined (reading 'docId') (via TypeError) 9:32:03 PM: [11ty] 9:32:03 PM: [11ty] Original error stack trace: TypeError: Cannot read properties of undefined (reading 'docId') 9:32:03 PM: [11ty] at Object.render_footnote_anchor_name [as footnote_anchor_name] (/opt/build/repo/node_modules/markdown-it-footnote/index.js:12:18) 9:32:03 PM: [11ty] at Object.render_footnote_ref [as footnote_ref] (/opt/build/repo/node_modules/markdown-it-footnote/index.js:30:27) 9:32:03 PM: [11ty] at Renderer.render (/opt/build/repo/node_modules/markdown-it/lib/renderer.js:332:38) 9:32:03 PM: [11ty] at /opt/build/repo/src/helpers/utils.js:17:36 9:32:03 PM: [11ty] at Array.forEach () 9:32:03 PM: [11ty] at namedHeadings (/opt/build/repo/src/helpers/utils.js:15:18) 9:32:03 PM: [11ty] at Core.process (/opt/build/repo/node_modules/markdown-it/lib/parser_core.js:54:13) 9:32:03 PM: [11ty] at MarkdownIt.parse (/opt/build/repo/node_modules/markdown-it/lib/index.js:524:13) 9:32:03 PM: [11ty] at MarkdownIt.render (/opt/build/repo/node_modules/markdown-it/lib/index.js:544:36) 9:32:03 PM: [11ty] at /opt/build/repo/node_modules/@11ty/eleventy/src/Engines/Markdown.js:79:38 9:32:03 PM: [11ty] Copied 6 files / Wrote 0 files in 0.15 seconds (v2.0.1) 9:32:03 PM: ERROR: "build:eleventy" exited with 1. 9:32:03 PM: ​ 9:32:03 PM: "build.command" failed
9:32:03 PM: ──────────────────────────────────────────────────────────────── 9:32:03 PM: ​ 9:32:04 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2) 9:32:03 PM: Error message 9:32:03 PM: Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1) 9:32:03 PM: ​ 9:32:03 PM: Error location 9:32:03 PM: In build.command from netlify.toml: 9:32:03 PM: npm install && npm run build 9:32:03 PM: ​ 9:32:03 PM: Resolved config 9:32:03 PM: build: 9:32:03 PM: command: npm install && npm run build 9:32:03 PM: commandOrigin: config 9:32:03 PM: publish: /opt/build/repo/dist 9:32:03 PM: publishOrigin: config 9:32:03 PM: functionsDirectory: /opt/build/repo/netlify/functions 9:32:03 PM: redirects: 9:32:04 PM: - from: /api/
status: 200 to: /.netlify/functions/:splat - from: /* status: 404 to: /404 redirectsOrigin: configCaching artifacts 9:32:04 PM: Started saving node modules 9:32:04 PM: Finished saving node modules 9:32:04 PM: Started saving build plugins 9:32:04 PM: Finished saving build plugins 9:32:04 PM: Started saving corepack cache 9:32:04 PM: Finished saving corepack cache 9:32:04 PM: Started saving pip cache 9:32:04 PM: Finished saving pip cache 9:32:04 PM: Started saving emacs cask dependencies 9:32:04 PM: Finished saving emacs cask dependencies 9:32:04 PM: Started saving maven dependencies 9:32:04 PM: Finished saving maven dependencies 9:32:04 PM: Started saving boot dependencies 9:32:04 PM: Finished saving boot dependencies 9:32:04 PM: Started saving rust rustup cache 9:32:04 PM: Finished saving rust rustup cache 9:32:04 PM: Started saving go dependencies 9:32:04 PM: Finished saving go dependencies 9:32:04 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 9:32:04 PM: Failing build: Failed to build site 9:32:04 PM: Finished processing build request in 22.223s

Here is the error message on Vercel: [19:17:23.231] Running build in San Francisco, USA (West) – sfo1 [19:17:23.291] Cloning github.com/xxx/xxx (Branch: main, Commit: 8ab3aa4) [19:17:24.199] Cloning completed: 907.196ms [19:17:24.493] Restored build cache [19:17:24.522] Running "vercel build" [19:17:24.969] Vercel CLI 28.18.5 [19:17:25.940] Running "install" command: npm install... [19:17:28.469] [19:17:28.470] up to date, audited 555 packages in 2s [19:17:28.470] [19:17:28.470] 98 packages are looking for funding [19:17:28.470] run npm fund for details [19:17:28.486] [19:17:28.486] 14 vulnerabilities (2 moderate, 9 high, 3 critical) [19:17:28.486] [19:17:28.487] To address issues that do not require attention, run: [19:17:28.487] npm audit fix [19:17:28.487] [19:17:28.487] Some issues need review, and may require choosing [19:17:28.487] a different dependency. [19:17:28.487] [19:17:28.487] Run npm audit for details. [19:17:28.802] [19:17:28.802] > web@1.0.0 build [19:17:28.802] > npm-run-all get-theme build:* [19:17:28.802] [19:17:29.223] [19:17:29.223] > web@1.0.0 get-theme [19:17:29.223] > node src/site/get-theme.js [19:17:29.223] [19:17:29.623] [19:17:29.623] > web@1.0.0 build:eleventy [19:17:29.623] > cross-env ELEVENTY_ENV=prod NODE_OPTIONS=--max-old-space-size=4096 eleventy [19:17:29.624] [19:17:30.590] [11ty] Problem writing Eleventy templates: (more in DEBUG output) [19:17:30.591] [11ty] 1. Having trouble rendering njk template ./src/site/notes/xxx/xxx.md (via TemplateContentRenderError) [19:17:30.591] [11ty] 2. Cannot read properties of undefined (reading 'docId') (via TypeError) [19:17:30.591] [11ty] [19:17:30.591] [11ty] Original error stack trace: TypeError: Cannot read properties of undefined (reading 'docId') [19:17:30.591] [11ty] at Object.render_footnote_anchor_name [as footnote_anchor_name] (/vercel/path0/node_modules/markdown-it-footnote/index.js:12:18) [19:17:30.592] [11ty] at Object.render_footnote_ref [as footnote_ref] (/vercel/path0/node_modules/markdown-it-footnote/index.js:30:27) [19:17:30.592] [11ty] at Renderer.render (/vercel/path0/node_modules/markdown-it/lib/renderer.js:332:38) [19:17:30.592] [11ty] at /vercel/path0/src/helpers/utils.js:17:36 [19:17:30.592] [11ty] at Array.forEach () [19:17:30.592] [11ty] at namedHeadings (/vercel/path0/src/helpers/utils.js:15:18) [19:17:30.592] [11ty] at Core.process (/vercel/path0/node_modules/markdown-it/lib/parser_core.js:54:13) [19:17:30.592] [11ty] at MarkdownIt.parse (/vercel/path0/node_modules/markdown-it/lib/index.js:524:13) [19:17:30.592] [11ty] at MarkdownIt.render (/vercel/path0/node_modules/markdown-it/lib/index.js:544:36) [19:17:30.592] [11ty] at /vercel/path0/node_modules/@11ty/eleventy/src/Engines/Markdown.js:79:38 [19:17:30.593] [11ty] Copied 5 files / Wrote 0 files in 0.18 seconds (v2.0.1) [19:17:30.611] ERROR: "build:eleventy" exited with 1. [19:17:30.632] Error: Command "npm run build" exited with 1 [19:17:30.933] Deployment completed [19:17:30.888] BUILD_UTILS_SPAWN_1: Command "npm run build" exited with 1

Thank you so much!

dayne commented 1 year ago

Noticed this open bug report. Can't help with debug what you pasted myself but I can confirm that latest obsdiian + latest obsidian-digital-garden instructions for deploying on vercel work great.

So great I didn't even have any expanded notes needed in the process beyond what I put here:

https://hive.mod0.org/hive/digital-garden/

Perhaps revisit the vercel deployment steps and provide some more details on the error/issues if this is still an open issue for you.

BacKinnn commented 6 months ago

Did you have any footnote in the note? I had 2 that points to Excalidraw drawings, and when I delete the footnote and deploy again, everything works