oleeskild / digitalgarden

261 stars 147 forks source link

TypeError: data.date.toLowerCase is not a function #235

Closed wangzhankun closed 7 months ago

wangzhankun commented 7 months ago

build log is the following:

<pre class="c_rw c_bv c_nd c_jj c_ux c_uy c_dd c_vl c_vm c_vn c_vo c_gf c_gg c_uz c_bx c_vp" style="box-sizing: border-box; border-radius: 0px; color: rgb(49, 49, 49); display: block; font-size: 12px; margin: 0px; overflow: auto; padding: 16px 32px; width: 854.26px; background-color: rgb(242, 242, 242); border-width: 0px 0px 1px; border-style: solid; border-color: rgb(217, 217, 217); border-image: initial; font-family: monaco, courier, monospace; height: 500px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
09:59:11.642 | Cloning repository...
-- | --
09:59:12.673 | From https://github.com/wangzhankun/knowledge4public
09:59:12.674 | * branch            ab30255994069de770f6fa43728619094193b529 -> FETCH_HEAD
09:59:12.674 |  
09:59:12.799 | HEAD is now at ab30255 Delete content src/site/notes/TEE/RISCV Ubuntu Linux内核更换.md
09:59:12.800 |  
09:59:12.905 |  
09:59:12.938 | Success: Finished cloning repository files
09:59:13.885 | Detected the following tools from environment: npm@9.6.7, nodejs@18.17.1
09:59:13.886 | Installing project dependencies: npm clean-install --progress=false
09:59:24.397 |  
09:59:24.397 | added 487 packages, and audited 488 packages in 10s
09:59:24.397 |  
09:59:24.398 | 119 packages are looking for funding
09:59:24.398 | run `npm fund` for details
09:59:24.402 |  
09:59:24.403 | 4 vulnerabilities (2 moderate, 2 high)
09:59:24.403 |  
09:59:24.403 | To address issues that do not require attention, run:
09:59:24.403 | npm audit fix
09:59:24.404 |  
09:59:24.404 | Some issues need review, and may require choosing
09:59:24.404 | a different dependency.
09:59:24.404 |  
09:59:24.404 | Run `npm audit` for details.
09:59:24.421 | Executing user command: npm run build
09:59:25.276 |  
09:59:25.276 | > web@1.0.0 build
09:59:25.276 | > npm-run-all get-theme build:*
09:59:25.276 |  
09:59:25.860 |  
09:59:25.860 | > web@1.0.0 get-theme
09:59:25.861 | > node src/site/get-theme.js
09:59:25.861 |  
09:59:26.505 |  
09:59:26.505 | > web@1.0.0 build:eleventy
09:59:26.505 | > cross-env ELEVENTY_ENV=prod NODE_OPTIONS=--max-old-space-size=4096 eleventy
09:59:26.506 |  
09:59:28.161 | [11ty] Problem writing Eleventy templates: (more in DEBUG output)
09:59:28.162 | [11ty] data.date.toLowerCase is not a function (via TypeError)
09:59:28.162 | [11ty]
09:59:28.162 | [11ty] Original error stack trace: TypeError: data.date.toLowerCase is not a function
09:59:28.162 | [11ty]     at Template.getMappedDate (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/Template.js:940:21)
09:59:28.163 | [11ty]     at Template.addPageDate (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/Template.js:403:30)
09:59:28.163 | [11ty]     at Template.getData (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/Template.js:390:29)
09:59:28.163 | [11ty]     at async TemplateMap.add (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateMap.js:65:16)
09:59:28.163 | [11ty]     at async Promise.all (index 8)
09:59:28.163 | [11ty]     at async TemplateWriter._createTemplateMap (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:325:5)
09:59:28.163 | [11ty]     at async TemplateWriter.generateTemplates (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:360:5)
09:59:28.163 | [11ty]     at async TemplateWriter.write (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:407:23)
09:59:28.164 | [11ty]     at async Eleventy.executeBuild (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/Eleventy.js:1191:13)
09:59:28.164 | [11ty] Copied 63 files / Wrote 0 files in 0.24 seconds (v2.0.1)
09:59:28.218 | ERROR: "build:eleventy" exited with 1.
09:59:28.233 | Failed: Error while executing user command. Exited with error code: 1
09:59:28.243 | Failed: build command exited with code: 1
09:59:29.193 | Failed: error occurred while running build command

</pre>

I don't know if this has something to do with my template. I have write the front-matter in my template and have applied to many notes:

---
dg-publish: "true"
date: {{date}}
time: {{time}}
progress: 进行中
tags: 
  - 
---
wangzhankun commented 7 months ago

It's my fault. I should never publish the template which has no real date.