gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

gatsby build, Building HTML fails, ERROR plugin.plugin[api] is not a function #18268

Closed yzalvov closed 5 years ago

yzalvov commented 5 years ago

Description

Plugins I use: gatsby-source-contentful (creating pages with createPages API), gatsby-plugin-material-ui, gatsby-plugin-styled-components

gatsby develop works fine. Please help.

Steps to reproduce

gatsby build fails with an error

Expected result

Successfully built project.

Actual result

ERROR #95313
Building static HTML failed...
TypeError: plugin.plugin[api] is not a function

- render-page.js:120 plugins.map.plugin
    /Users/pzd/code/myproject/public/render-page.js:120:107

  - Array.map

  - render-page.js:120 ./.cache/api-runner-ssr.js.module.exports
    /Users/pzd/code/myproject/public/render-page.js:120:21

  - render-page.js:548 Module../.cache/static-entry.js.__webpack_exports__.default
    /Users/pzd/code/myproject/public/render-page.js:548:510

  - render-html.js:35 Promise
    [myproject]/[gatsby]/dist/utils/worker/render-html.js:35:36

  - debuggability.js:313 Promise._execute
    [myproject]/[bluebird]/js/release/debuggability.js:313:9

  - promise.js:488 Promise._resolveFromExecutor
    [myproject]/[bluebird]/js/release/promise.js:488:18

  - promise.js:79 new Promise
    [myproject]/[bluebird]/js/release/promise.js:79:10

  - render-html.js:31 Promise.map.path
    [myproject]/[gatsby]/dist/utils/worker/render-html.js:31:37

  - util.js:16 tryCatcher
    [myproject]/[bluebird]/js/release/util.js:16:23

  - map.js:61 MappingPromiseArray._promiseFulfilled
    [myproject]/[bluebird]/js/release/map.js:61:38

  - promise_array.js:114 MappingPromiseArray.PromiseArray._iterate
    [myproject]/[bluebird]/js/release/promise_array.js:114:31

  - promise_array.js:78 MappingPromiseArray.init
    [myproject]/[bluebird]/js/release/promise_array.js:78:10

  - map.js:30 MappingPromiseArray._asyncInit
    [myproject]/[bluebird]/js/release/map.js:30:10

  - async.js:142 _drainQueueStep
    [myproject]/[bluebird]/js/release/async.js:142:12

  - async.js:131 _drainQueue
    [myproject]/[bluebird]/js/release/async.js:131:9

Environment

System: OS: macOS 10.14.6 CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm Languages: Python: 2.7.16 - /Library/Frameworks/Python.framework/Versions/2.7/bin/python Browsers: Chrome: 77.0.3865.90 Safari: 13.0.1 npmPackages: gatsby: ^2.7.1 => 2.13.50 gatsby-background-image: ^0.8.5 => 0.8.5 gatsby-image: ^2.1.1 => 2.1.1 gatsby-plugin-google-tagmanager: ^2.1.12 => 2.1.12 gatsby-plugin-manifest: ^2.1.1 => 2.2.4 gatsby-plugin-material-ui: latest => 2.1.6 gatsby-plugin-offline: ^2.1.1 => 2.1.1 gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12 gatsby-plugin-remove-console: ^0.0.2 => 0.0.2 gatsby-plugin-sharp: ^2.1.1 => 2.1.1 gatsby-plugin-styled-components: ^3.1.5 => 3.1.5 gatsby-source-contentful: ^2.1.45 => 2.1.45 gatsby-source-filesystem: ^2.0.37 => 2.0.37 gatsby-transformer-sharp: ^2.1.19 => 2.1.19

yzalvov commented 5 years ago

I bet on gatsby-source-contentful, because when I change some content on Contentful's side, gatsby build / Building static HTML fails for a different path. But I haven't figured out how to find the source of the problem yet.

AbdulRahimFarooqui commented 3 years ago

Any idea how to solve this error? I have almost exact same one.