Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to always return array within reduce function #1851

Merged
merged 1 commit into from
Aug 18, 2017

Conversation

okcoker
Copy link
Contributor

@okcoker okcoker commented Aug 18, 2017

Went to update my site and noticed I can't currently build my site. Not sure what happened between now and the last time I built my site as things were working fine. I assume things are broken for me now because of the non-exact dependency versions. In hopes of fixing my problem, I tried upgrading gatsby (from 1.4.1 to the latest 1.8.11) and got an error at the .concat call within the findDirtyIds function where dirtyIds was undefined. I would think using reduce should always return the accumulator argument.

Adding this fix now gives me the error listed here #1659.

In case you need the output from the console.

$ node -v
v7.1.0
$ gatsby -V
1.8.11
$ gatsby build
info One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's not any stale
data
success copy gatsby files — 0.049 s
success source and transform nodes — 0.308 s
success building schema — 0.320 s
success createLayouts — 0.009 s
success createPages — 0.055 s
success createPagesStatefully — 0.039 s
success extract queries from components — 0.177 s
error UNHANDLED REJECTION


  TypeError: Cannot read property 'concat' of undefined

  - page-query-runner.js:152
    [web]/[gatsby]/dist/internal-plugins/query-runner/page-query-runner.js:152:24

  - Array.reduce

  - page-query-runner.js:144 findDirtyIds
    [web]/[gatsby]/dist/internal-plugins/query-runner/page-query-runner.js:144:18

  - page-query-runner.js:46 _callee$
    [web]/[gatsby]/dist/internal-plugins/query-runner/page-query-runner.js:46:22

  - index.js:386 _callee$
    [web]/[gatsby]/dist/bootstrap/index.js:386:20

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit c874907

https://deploy-preview-1851--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Good catch! Thanks!

@KyleAMathews KyleAMathews merged commit 973bc1d into gatsbyjs:master Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants