QardsJs / qards

Qards is a blogging platform focused on performance and on closing the gap between content publishers and developers: https://qards.io
MIT License
239 stars 16 forks source link

WebpackError: TypeError: Cannot read property 'length' of undefined #79

Closed fr0der1c closed 5 years ago

fr0der1c commented 5 years ago

I updated to the latest commit. And the following error occurs when building:

5:04:13 PM: error Building static HTML for pages failed
5:04:13 PM: See our docs page on debugging HTML builds for help https://goo.gl/yL9lND
5:04:13 PM:   77 |
5:04:13 PM:   78 |                      <Box mb={postsMb}>
5:04:13 PM: > 79 |                          {posts.length> 0 && <Posts
5:04:13 PM:      |                                 ^
5:04:13 PM:   80 |                              showExcerpt={getPostsConfig(['showExcerpts'], true)}
5:04:13 PM:   81 |                              posts={posts}
5:04:13 PM:   82 |                              title={`Latest articles`}
5:04:13 PM: 
5:04:13 PM:   WebpackError: TypeError: Cannot read property 'length' of undefined
5:04:13 PM:   
5:04:13 PM:   - index.tsx:79 IndexPage.render
5:04:13 PM:     lib/src/components/pages/posts/index.tsx:79:15
5:04:13 PM:   
5:04:13 PM:   - bootstrap:19 c
5:04:13 PM:     lib/webpack/bootstrap:19:1
5:04:13 PM:   
5:04:13 PM:   
5:04:13 PM:   - bootstrap:25 a.render
5:04:13 PM:     lib/webpack/bootstrap:25:1
5:04:13 PM:   
5:04:13 PM:   - bootstrap:24 a.read
5:04:13 PM:     lib/webpack/bootstrap:24:1
5:04:13 PM:   
5:04:13 PM:   - bootstrap:36 renderToString
5:04:13 PM:     lib/webpack/bootstrap:36:1
5:04:13 PM:   
5:04:13 PM:   - static-entry.js:190 Module../.cache/static-entry.js.__webpack_exports__.defa    ult
5:04:13 PM:     lib/.cache/static-entry.js:190:18
5:04:13 PM:   
5:04:13 PM:   - bootstrap:24 Promise
5:04:13 PM:     lib/webpack/bootstrap:24:1
5:04:13 PM:   
5:04:13 PM:   
5:04:13 PM:   - default-html.js:22 Promise._resolveFromExecutor
5:04:13 PM:     lib/.cache/default-html.js:22:13
5:04:13 PM:   
5:04:13 PM:   - bootstrap:68 new Promise
5:04:13 PM:     lib/webpack/bootstrap:68:1
5:04:13 PM:   
5:04:14 PM:   
5:04:14 PM:   - bootstrap:5 tryCatcher
5:04:14 PM:     lib/webpack/bootstrap:5:1
5:04:14 PM:   
5:04:14 PM:   - bootstrap:50 MappingPromiseArray._promiseFulfilled
5:04:14 PM:     lib/webpack/bootstrap:50:1
5:04:14 PM:   
5:04:14 PM:   - api-runner-ssr.js:6 MappingPromiseArray.PromiseArray._iterate
5:04:14 PM:     lib/.cache/api-runner-ssr.js:6:27
5:04:14 PM:   
5:04:14 PM:   - bootstrap:67 MappingPromiseArray.init
5:04:14 PM:     lib/webpack/bootstrap:67:1
ciokan commented 5 years ago

Is your app on public github so I can take a look?

fr0der1c commented 5 years ago

Yes. https://github.com/fr0der1c/blog

ciokan commented 5 years ago

Fixed by : https://github.com/QardsJs/qards/commit/15a4895db7cf9413b55284be7e22c9a2729bf8ed https://github.com/QardsJs/qards/commit/d4f67177d96747820933f0184812f9160a1d969a https://github.com/QardsJs/qards/commit/3cb7dbe474d769d9254b2eb9fc479725593b8ba9

There have been many breaking changes lately but I cloned your website and applied the updates and it seems to work fine. Also I fixed the categories that we're leading to page not found. Please confirm.

fr0der1c commented 5 years ago

Thanks for the fix. I can confirm it's working again.