azat-io / vuepress-plugin-open-graph

📗 VuePress v2 plugin for generating open graph meta tags to improve SEO
MIT License
2 stars 1 forks source link

Error in `extendsPage` #1

Closed fdevans closed 1 year ago

fdevans commented 1 year ago

Getting this error trying to add the plugin to our site:

⠹ Initializing and preparing dataerror error in hook extendsPage from vuepress-plugin-open-graph
✖ Initializing and preparing data - failed in 9.22s
RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at Object.extendsPage [as hook] (file:///Users/forrestevans/Documents/GitHub/docs/node_modules/vuepress-plugin-open-graph/dist/server/index.js:19:62)
    at Object.process (file:///Users/forrestevans/Documents/GitHub/docs/node_modules/@vuepress/core/dist/index.js:681:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async createPage (file:///Users/forrestevans/Documents/GitHub/docs/node_modules/@vuepress/core/dist/index.js:568:3)
    at async Promise.all (index 296)
    at async resolveAppPages (file:///Users/forrestevans/Documents/GitHub/docs/node_modules/@vuepress/core/dist/index.js:580:17)
    at async appInit (file:///Users/forrestevans/Documents/GitHub/docs/node_modules/@vuepress/core/dist/index.js:603:15)
    at async file:///Users/forrestevans/Documents/GitHub/docs/node_modules/@vuepress/cli/dist/index.js:487:7
    at async file:///Users/forrestevans/Documents/GitHub/docs/node_modules/@vuepress/utils/dist/index.js:106:20

Using the latest build of 2.0.0-beta.67

fdevans commented 1 year ago

It seems like this line assumes every page without a layout specified will have a date entry. We have some pages with Frontmatter but may not have a date. Am I on the right track?

https://github.com/azat-io/vuepress-plugin-open-graph/blob/44cbebec134a9ca4e1ab5f4daf40b6ba6a37c234/server/index.ts#L40