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

1.9.210 causes 'TypeError: Cannot read property 'internal' of undefined' #4216

Closed
orf opened this Issue Feb 24, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@orf
Copy link

orf commented Feb 24, 2018

Description

In 1.9.210 and above, running yarn build or yarn dev fails with an unhandled promise exception. In the stacktrace gatsby-remark-copy-linked-files is mentioned, but removing that from the build throws a similar error linked below this one in core gatsby.

Solution: pin gatsby to 19.209 and everything seems to work as expected.

$ gatsby build
success delete html and css files from previous builds — 0.052 s
success open and validate gatsby-config.js — 0.007 s
success copy gatsby files — 0.028 s
success onPreBootstrap — 0.491 s
success source and transform nodes — 1.009 s
success building schema — 0.662 s
success createLayouts — 0.011 s
error Cannot read property 'internal' of undefined

  TypeError: Cannot read property 'internal' of undefined
  - index.js:161
    [blog-gatsby]/[gatsby-remark-copy-linked-files]/index.js:161:60
  - index.js:31 one
    [blog-gatsby]/[unist-util-visit]/index.js:31:16
  - index.js:54 all
    [blog-gatsby]/[unist-util-visit]/index.js:54:25
  - index.js:39 one
    [blog-gatsby]/[unist-util-visit]/index.js:39:14
  - index.js:54 all
    [blog-gatsby]/[unist-util-visit]/index.js:54:25
  - index.js:39 one
    [blog-gatsby]/[unist-util-visit]/index.js:39:14
  - index.js:22 visit
    [blog-gatsby]/[unist-util-visit]/index.js:22:3
  - index.js:154 module.exports
    [blog-gatsby]/[gatsby-remark-copy-linked-files]/index.js:154:3
  - extend-node-type.js:168
    [blog-gatsby]/[gatsby-transformer-remark]/extend-node-type.js:168:32
  - util.js:16 tryCatcher
    [blog-gatsby]/[bluebird]/js/release/util.js:16:23
  - reduce.js:155 Object.gotValue
    [blog-gatsby]/[bluebird]/js/release/reduce.js:155:18
  - reduce.js:144 Object.gotAccum
    [blog-gatsby]/[bluebird]/js/release/reduce.js:144:25
  - util.js:16 Object.tryCatcher
    [blog-gatsby]/[bluebird]/js/release/util.js:16:23
  - promise.js:512 Promise._settlePromiseFromHandler
    [blog-gatsby]/[bluebird]/js/release/promise.js:512:31
  - promise.js:569 Promise._settlePromise
    [blog-gatsby]/[bluebird]/js/release/promise.js:569:18
  - promise.js:606 Promise._settlePromiseCtx
    [blog-gatsby]/[bluebird]/js/release/promise.js:606:10

And:

error Cannot read property 'internal' of null


  TypeError: Cannot read property 'internal' of null

  - infer-graphql-input-fields.js:222
    [blog-gatsby]/[gatsby]/dist/schema/infer-graphql-input-fields.js:222:37

  - lodash.js:4917
    [blog-gatsby]/[lodash]/lodash.js:4917:15

  - lodash.js:3002 baseForOwn
    [blog-gatsby]/[lodash]/lodash.js:3002:24

  - lodash.js:4886
    [blog-gatsby]/[lodash]/lodash.js:4886:18

  - lodash.js:9334 Function.forEach
    [blog-gatsby]/[lodash]/lodash.js:9334:14

  - infer-graphql-input-fields.js:209 inferInputObjectStructureFromNodes
    [blog-gatsby]/[gatsby]/dist/schema/infer-graphql-input-fields.js:209:5

  - build-node-types.js:88 _callee$
    [blog-gatsby]/[gatsby]/dist/schema/build-node-types.js:88:36

  - next_tick.js:73 _combinedTickCallback
    internal/process/next_tick.js:73:7

  - next_tick.js:104 process._tickCallback
    internal/process/next_tick.js:104:9

Environment

Gatsby version: 1.9.210
Node.js version: 8.9.3
Operating System: MacOS

Steps to reproduce

1. Clone https://github.com/orf/blog-gatsby/tree/210 (branch 210)

2. Run yarn && yarn build

3. See that it errors

...

@deltaskelta

This comment has been minimized.

Copy link
Contributor

deltaskelta commented Feb 24, 2018

I can confirm I am getting the of null variety of the error starting with 1.9.210

@orf

This comment has been minimized.

Copy link

orf commented Feb 24, 2018

Tracked it down to a937768

KyleAMathews added a commit that referenced this issue Feb 24, 2018

@KyleAMathews

This comment has been minimized.

Copy link
Contributor

KyleAMathews commented Feb 24, 2018

Sorry folks — missed this earlier. Had a test and everything but the test didn't catch it. Improved the test & fixed the bug. Will release once tests run.

@wafflebot wafflebot bot added the review label Feb 24, 2018

@KyleAMathews

This comment has been minimized.

Copy link
Contributor

KyleAMathews commented Feb 24, 2018

@orf spot on :-) sorry if I spoiled your fun — look like you were pretty close to fixing this :-)

@orf

This comment has been minimized.

Copy link

orf commented Feb 24, 2018

I was going to give it a shot, but I doubt I would have found that! I was studying the diff for a while and didn't spot the issue :(

Thanks for fixing it so quick though 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment