gatsby: Running Gatsby build gives Error: 856328897 TypeError: promise.finally is not a function

Description

When I run gatsby build or npm install I get the error Error: 856328897 TypeError: promise.finally is not a function

Steps to reproduce

I was getting missing images when deploying to netlify so I cleaned my local install then started getting these errors when I runnpm install or gatsby build - https://github.com/payello/suggestions-2020 this is my repo.

How to Make a Minimal Reproduction: https://www.gatsbyjs.org/contributing/how-to-make-a-reproducible-test-case/

Expected result

What should happen? The files should build as usual

Actual result

What happened.

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

System: OS: macOS 10.15.4 CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 12.13.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.12.0 - /usr/local/bin/npm Languages: Python: 2.7.12 - /Library/Frameworks/Python.framework/Versions/2.7/bin/python Browsers: Chrome: 81.0.4044.122 Firefox: 75.0 Safari: 13.1 npmPackages: gatsby: ^2.19.7 => 2.21.0 gatsby-image: ^2.2.39 => 2.4.0 gatsby-plugin-manifest: ^2.2.39 => 2.4.0 gatsby-plugin-offline: ^3.0.32 => 3.2.0 gatsby-plugin-react-helmet: ^3.1.21 => 3.3.0 gatsby-plugin-sharp: ^2.4.3 => 2.6.0 gatsby-plugin-styled-components: ^3.2.1 => 3.3.0 gatsby-source-contentful: ^2.2.7 => 2.3.0 gatsby-source-filesystem: ^2.1.46 => 2.3.0 gatsby-transformer-sharp: ^2.3.13 => 2.5.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 25 (11 by maintainers)

Most upvoted comments

Reverted to 2.20.28 and it fixed my issue as well.

I ran into the same issue and had to revert my gatsby package to 2.20.28. Everything works as expected for me with that version. There was a ‘promise.finally’ added to 'packages/gatsby/src/query/query-runner.js` in version 2.20.29 (4-22). I believe that was the issue for me.

Me too thank you @timbiles!

As activity here has gone quiet, I’m going to assume that one of the fixes above or upgrades to either gatsby, yarn, or other libraries has everyone resolved and doing their best work! 😃

If anyone is still stuck with this same error, please re-open this issue with updated environment information and a minimum reproduction. 💜

Seeing the same issue running gatsby develop. Reinstalled gatsby-cli globally, removed node_modules and reinstalled - and no improvement.

Downgraded to 2.20.28 and the issue was resolved.

I had just started a new project with gatsby new restaurant-gatsby and after that did gatsby develop and got the same error.

 TypeError: promise.finally is not a function

  - query-runner.js:60 graphql
    [restaurant-gatsby]/[gatsby]/dist/query/query-runner.js:60:20

  - query-runner.js:73 module.exports
    [restaurant-gatsby]/[gatsby]/dist/query/query-runner.js:73:20

  - queue.js:32 Worker.handler [as fn]
    [restaurant-gatsby]/[gatsby]/dist/query/queue.js:32:43

  - worker.js:69 Worker.start
    [restaurant-gatsby]/[better-queue]/lib/worker.js:69:29

  - queue.js:701 Queue._startBatch
    [restaurant-gatsby]/[better-queue]/lib/queue.js:701:12

  - queue.js:567
    [restaurant-gatsby]/[better-queue]/lib/queue.js:567:12

  - better-queue-custom-store.js:180 Object.getLock
    [restaurant-gatsby]/[gatsby]/dist/query/better-queue-custom-store.js:180:7

  - queue.js:533
    [restaurant-gatsby]/[better-queue]/lib/queue.js:533:17

  - better-queue-custom-store.js:128 Object.takeFirstN
    [restaurant-gatsby]/[gatsby]/dist/query/better-queue-custom-store.js:128:7

  - queue.js:473 Queue._getNextBatch
    [restaurant-gatsby]/[better-queue]/lib/queue.js:473:54

  - queue.js:530 Queue._processNext
    [restaurant-gatsby]/[better-queue]/lib/queue.js:530:8

  - queue.js:520
    [restaurant-gatsby]/[better-queue]/lib/queue.js:520:12

  - queue.js:26 Queue.self.precondition
    [restaurant-gatsby]/[better-queue]/lib/queue.js:26:60

  - queue.js:511 Queue._processNextIfAllowed
    [restaurant-gatsby]/[better-queue]/lib/queue.js:511:8

  - queue.js:484 Immediate.<anonymous>
    [restaurant-gatsby]/[better-queue]/lib/queue.js:484:12

  - timers.js:439 processImmediate
    internal/timers.js:439:21

Output of gatsby info --clipboard is below

  System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
    Shell: 3.0.2 - /usr/local/bin/fish
  Binaries:
    Node: 12.8.0 - /usr/local/bin/node
    npm: 6.10.2 - /usr/local/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 81.0.4044.122
    Firefox: 75.0
    Safari: 12.0.3
  npmPackages:
    gatsby: ^2.21.0 => 2.21.0
    gatsby-image: ^2.4.0 => 2.4.0
    gatsby-plugin-manifest: ^2.4.0 => 2.4.0
    gatsby-plugin-offline: ^3.2.0 => 3.2.0
    gatsby-plugin-react-helmet: ^3.3.0 => 3.3.0
    gatsby-plugin-sharp: ^2.6.0 => 2.6.0
    gatsby-source-filesystem: ^2.3.0 => 2.3.0
    gatsby-transformer-sharp: ^2.5.0 => 2.5.0
  npmGlobalPackages:
    gatsby-cli: 2.4.15