Skip to content

Allow blog posts without cover image #6

@zohaad

Description

@zohaad

I'm getting the following error in my deploy GitHub action, and I think it's because I don't have a cover image:

2022-04-30T21:18:44.3758138Z yarn install v1.22.18
2022-04-30T21:18:44.4447506Z [1/4] Resolving packages...
2022-04-30T21:18:44.6143394Z success Already up-to-date.
2022-04-30T21:18:44.6231339Z Done in 0.25s.
2022-04-30T21:18:44.7779136Z yarn run v1.22.18
2022-04-30T21:18:44.8091286Z $ APP_ENV=prod yarn build && next export
2022-04-30T21:18:44.9928841Z $ next build && yarn build:rss
2022-04-30T21:18:45.4634460Z info  - Loaded env from /home/runner/work/blog.***/blog.***/.env
2022-04-30T21:18:45.6560265Z info  - Checking validity of types...
2022-04-30T21:18:48.5089458Z warn  - No ESLint configuration detected. Run next lint to begin setup
2022-04-30T21:18:48.5106738Z info  - Creating an optimized production build...
2022-04-30T21:18:53.7098316Z info  - Compiled successfully
2022-04-30T21:18:53.7099406Z info  - Collecting page data...
2022-04-30T21:18:54.4366556Z info  - Generating static pages (0/6)
2022-04-30T21:18:54.4583991Z info  - Generating static pages (1/6)
2022-04-30T21:18:54.4615839Z cover missing for post: {
2022-04-30T21:18:54.4616625Z   id: 'b93ca130-a39e-489d-b6d6-ccf914e96eec',
2022-04-30T21:18:54.4617233Z   slug: 'fun-quotes',
2022-04-30T21:18:54.4617750Z   author: 'Zohaad Fazal',
2022-04-30T21:18:54.4618436Z   date: { start: '2022-04-28', end: null, time_zone: null },
2022-04-30T21:18:54.4618985Z   published: true,
2022-04-30T21:18:54.4619484Z   title: 'Fun quotes',
2022-04-30T21:18:54.4620093Z   subtitle: 'Some cool quotes for me to copy-paste',
2022-04-30T21:18:54.4620665Z   language: 'English'
2022-04-30T21:18:54.4621104Z }
2022-04-30T21:18:54.5004186Z info  - Generating static pages (2/6)
2022-04-30T21:18:54.6339541Z 
2022-04-30T21:18:54.6340727Z Error occurred prerendering page "/fun-quotes". Read more: https://nextjs.org/docs/messages/prerender-error
2022-04-30T21:18:54.6341747Z TypeError: Cannot read properties of undefined (reading 'file')
2022-04-30T21:18:54.6342666Z     at Slug (/home/runner/work/blog.***/blog.***/.next/server/pages/[slug].js:572:192)
2022-04-30T21:18:54.6343811Z     at d (/home/runner/work/blog.***/blog.***/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
2022-04-30T21:18:54.6345023Z     at bb (/home/runner/work/blog.***/blog.***/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
2022-04-30T21:18:54.6346253Z     at a.b.render (/home/runner/work/blog.***/blog.***/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
2022-04-30T21:18:54.6347444Z     at a.b.read (/home/runner/work/blog.***/blog.***/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
2022-04-30T21:18:54.6348907Z     at Object.exports.renderToString (/home/runner/work/blog.***/blog.***/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
2022-04-30T21:18:54.6349993Z     at Object.renderPage (/home/runner/work/blog.***/blog.***/node_modules/next/dist/server/render.js:621:45)
2022-04-30T21:18:54.6350995Z     at Object.defaultGetInitialProps (/home/runner/work/blog.***/blog.***/node_modules/next/dist/server/render.js:301:51)
2022-04-30T21:18:54.6351948Z     at Function.getInitialProps (/home/runner/work/blog.***/blog.***/.next/server/chunks/859.js:497:20)
2022-04-30T21:18:54.6353217Z     at Object.loadGetInitialProps (/home/runner/work/blog.***/blog.***/node_modules/next/dist/shared/lib/utils.js:69:29)
2022-04-30T21:18:54.6354615Z info  - Generating static pages (4/6)
2022-04-30T21:18:55.5316186Z info  - Generating static pages (6/6)
2022-04-30T21:18:55.5316748Z 
2022-04-30T21:18:55.5317040Z > Build error occurred
2022-04-30T21:18:55.5317675Z Error: Export encountered errors on following paths:
2022-04-30T21:18:55.5318471Z 	/fun-quotes
2022-04-30T21:18:55.5319306Z     at /home/runner/work/blog.***/blog.***/node_modules/next/dist/export/index.js:493:19
2022-04-30T21:18:55.5319983Z     at runMicrotasks (<anonymous>)
2022-04-30T21:18:55.5320643Z     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-04-30T21:18:55.5321570Z     at async Span.traceAsyncFn (/home/runner/work/blog.***/blog.***/node_modules/next/dist/trace/trace.js:74:20)
2022-04-30T21:18:55.5322512Z     at async /home/runner/work/blog.***/blog.***/node_modules/next/dist/build/index.js:956:17
2022-04-30T21:18:55.5323439Z     at async Span.traceAsyncFn (/home/runner/work/blog.***/blog.***/node_modules/next/dist/trace/trace.js:74:20)
2022-04-30T21:18:55.5324370Z     at async /home/runner/work/blog.***/blog.***/node_modules/next/dist/build/index.js:830:13
2022-04-30T21:18:55.5325305Z     at async Span.traceAsyncFn (/home/runner/work/blog.***/blog.***/node_modules/next/dist/trace/trace.js:74:20)
2022-04-30T21:18:55.5326302Z     at async Object.build [as default] (/home/runner/work/blog.***/blog.***/node_modules/next/dist/build/index.js:80:25)
2022-04-30T21:18:55.5600232Z error Command failed with exit code 1.```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions