mdx-deck: mdx-deck start error with 'TypeError: Cannot read property 'internal' of null'

I’m creating a deck using the example from Zeit’s now-examples repository.

I can start a development server correctly and see the success: Building development bundle output from Gatsby, however as soon as I change a file the development server crashes with this error:

  TypeError: Cannot read property 'internal' of null
  
  - gen-mdx.js:48 payloadCacheKey
    [javascript-slides]/[gatsby-plugin-mdx]/utils/gen-mdx.js:48:46
  
  - gen-mdx.js:51 genMDX
    [javascript-slides]/[gatsby-plugin-mdx]/utils/gen-mdx.js:51:43
  
  - source-nodes.js:108 processMDX
    [javascript-slides]/[gatsby-plugin-mdx]/gatsby/source-nodes.js:108:5
  
  - source-nodes.js:158 resolve
    [javascript-slides]/[gatsby-plugin-mdx]/gatsby/source-nodes.js:158:35
  
  - gatsby-node.js:40 
    [javascript-slides]/[gatsby-theme-mdx-deck]/gatsby-node.js:40:24
  
  - gatsby-node.js:47 resolveTitle
    [javascript-slides]/[gatsby-theme-mdx-deck]/gatsby-node.js:47:60
  

not finished createPages - 0.077s


——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
3 pages                                                                    In Progress                                                                    mdx-deck
Error: Command failed with exit code 1 (EPERM): gatsby develop --host localhost --port 8000 --open
    at makeError (/Users/jackleslie/Desktop/Talks/javascript-slides/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/Users/jackleslie/Desktop/Talks/javascript-slides/node_modules/execa/index.js:112:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Here’s my project for reference, nothing much to see at the moment

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 20
  • Comments: 18 (4 by maintainers)

Most upvoted comments

Same here, the fix does not work for “mdx-deck”: “^3.0.13”

I added the following and it worked

“resolutions”: { “mdx-deck/**/gatsby”: “2.18.4” },

I’m using yarn.

I would suggest keeping this issue open until a fix is in place in the repo itself, not specific to pinning a sub-dependency version and using yarn. Looks like https://github.com/jxnblk/mdx-deck/pull/603 fixes it. Also might be a duplicate of https://github.com/jxnblk/mdx-deck/issues/595.

Fix this now, in your own project (if you use yarn):

"resolutions": {
  "mdx-deck/gatsby": "2.18.4",
  "mdx-deck/gatsby-plugin-compile-es6-packages": "2.1.0"
}

Add the above to your package.json and run yarn to install the working package versions.

Thanks to @karlhorky #603


Also try

"mdx-deck/**/gatsby": "2.18.4"

via @mlouage https://github.com/jxnblk/mdx-deck/issues/598#issuecomment-570532764

I’ve been running into this issue constantly on 3.0.13. Basically if I save any markdown, the server crashes.

I tried the solution by @therealklanni but didn’t have any luck.

Here’s the source line:

https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-mdx/utils/gen-mdx.js#L48

It looks like between saves node is returned as null.

The gatsby-plugin-mdx version is 1.0.64, which is the latest at the time of writing this.

Is there a previous version that didn’t have this issue?

Yes, that’s what I do. It turned out to be more stable and flexible, for example I can configure a path prefix to deploy the presentation as github pages or in a domain containing many other pieces of content.

this seems like a dup of #595

+1

@nkuehn does pinning to the older version like in the code block below not work? Or do you not use Yarn?

Yarn Resolutions should only pin the version of gatsby that is a direct or transient dependency of mdx-deck, which wouldn’t impact the other versions of Gatsby that are required by other packages in your monorepo.

"resolutions": {
  "mdx-deck/**/gatsby": "2.18.4"
},

I conclude this this from the following text from the original Yarn Resolutions RFC:

  • a/**/b denotes all the nested dependencies b of the project’s dependency a.

Same here 😕