Gatsby: Cannot destructure property `activity` of 'undefined' or 'null' when running develop

Created on 3 Oct 2019  路  12Comments  路  Source: gatsbyjs/gatsby

Hi all, so I am running a pretty fresh install of Gatby and during develop I am getting the following error after the server successfully starts:

UNHANDLED REJECTION Cannot destructure property `activity` of 'undefined' or 'null'.



  TypeError: Cannot destructure property `activity` of 'undefined' or 'null'.

  - develop.js:126 createIndexHtml
    [dartdrones.com]/[gatsby]/dist/commands/develop.js:126:27

  - develop.js:338 FSWatcher.chokidar.watch.on
    [dartdrones.com]/[gatsby]/dist/commands/develop.js:338:11

  - index.js:483 FSWatcher.emitWithAll
    [dartdrones.com]/[chokidar]/index.js:483:8

  - index.js:573 FSWatcher._emit
    [dartdrones.com]/[chokidar]/index.js:573:10

  - fsevents-handler.js:250 FsEventsHandler.handleEvent
    [dartdrones.com]/[chokidar]/lib/fsevents-handler.js:250:14

  - fsevents-handler.js:205 FsEventsHandler.addOrChange
    [dartdrones.com]/[chokidar]/lib/fsevents-handler.js:205:8

  - fsevents-handler.js:303 watchCallback
    [dartdrones.com]/[chokidar]/lib/fsevents-handler.js:303:21

  - fsevents-handler.js:103 filteredListener
    [dartdrones.com]/[chokidar]/lib/fsevents-handler.js:103:7

  - fsevents-handler.js:127 cont.listeners.forEach.list
    [dartdrones.com]/[chokidar]/lib/fsevents-handler.js:127:11

  - Set.forEach

  - fsevents-handler.js:126 cont.watcher.createFSEventsInstance
    [dartdrones.com]/[chokidar]/lib/fsevents-handler.js:126:24

Not really sure where to start here?

stale? needs reproduction

All 12 comments

I'm getting the same error with a custom html.js in my src folder.

Same ^ extremely annoying as it crashes every time I edit the html.js file

Is there any kind of fix or known reason for this error? I keep getting it multiple times a day. While it's not the highest priority, because it doesn't happen in build, it's incredibly frustrating. I too have a custom HTML.js file in my src folder, but this happens when I don't change anything in it at seemingly random times.

In my case this error happens every time I edit gatsby-ssr.js during development.

Apologies for this! Can you please link to a minimal reproduction?

We'll get this fixed right after.

Also, please upgrade to the latest gatsby and gatsby-cli before that. We might've fixed it already 馃檪

@sidharthachatterjee

It's tough to create a repoduction.

@karataev says it only happens with an edited gatsby-ssr.js but I don't have an edited ssr file.

For me, it happened after I added a custom html.js file but it only happens sometimes. Generally, closing my IDE and re-running gatsby develop fixes it until it next happens.

Apologies for this! Can you please link to a minimal reproduction?

We'll get this fixed right after.

Also, please upgrade to the latest gatsby and gatsby-cli before that. We might've fixed it already 馃檪

For my case steps to reproduce are simple:

  1. Start a new project with the default starter: gatsby new my-default-starter https://github.com/gatsbyjs/gatsby-starter-default
  2. gatsby develop
  3. Do any change to gatsby-ssr.js (add console.log, for example) and save the file.

Catch the error in the console:

UNHANDLED REJECTION Cannot destructure property `activity` of 'undefined' or 'null'.



  TypeError: Cannot destructure property `activity` of 'undefined' or 'null'.

  - develop.js:131 createIndexHtml
    [gatsby-test]/[gatsby]/dist/commands/develop.js:131:27

  - develop.js:352 FSWatcher.chokidar.watch.on
    [gatsby-test]/[gatsby]/dist/commands/develop.js:352:11

  - index.js:494 FSWatcher.emitWithAll
    [gatsby-test]/[gatsby]/[chokidar]/index.js:494:8

  - index.js:585 FSWatcher._emit
    [gatsby-test]/[gatsby]/[chokidar]/index.js:585:10

  - nodefs-handler.js:360 closer._watchWithNodeFs
    [gatsby-test]/[gatsby]/[chokidar]/lib/nodefs-handler.js:360:20

I updated gatsby and gatsby-cli to the latest versions.

Gatsby CLI version: 2.8.5
Gatsby version: 2.17.4

gatsby-info

  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz
  Binaries:
    Yarn: 1.3.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 2.7.15 - /c/Python27/python
  Browsers:
    Edge: 44.18362.387.0
  npmPackages:
    gatsby: ^2.17.4 => 2.17.4
    gatsby-image: ^2.2.29 => 2.2.29
    gatsby-plugin-manifest: ^2.2.23 => 2.2.23
    gatsby-plugin-offline: ^3.0.16 => 3.0.16
    gatsby-plugin-react-helmet: ^3.1.13 => 3.1.13
    gatsby-plugin-sharp: ^2.2.32 => 2.2.32
    gatsby-source-filesystem: ^2.1.33 => 2.1.33
    gatsby-transformer-sharp: ^2.3.0 => 2.3.0

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Just want to contribute my findings to this issue. I've run into it a few times and always as a result of on-the-fly edits to html.js while running gatsby develop. Stopping and restarting gatsby develop fixes it.

Seeing the exact same problem as @huy-nguyen - any edits to a custom html.js whilst running gatsby develop cause this error.

This was fixed by @blainekasten in https://github.com/gatsbyjs/gatsby/pull/19544 and published in [email protected] 馃檪

Please reopen in case you're still seeing the issue after upgrading!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

ghost picture ghost  路  3Comments

signalwerk picture signalwerk  路  3Comments