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

Yet another error #59313 during build (develop works fine) #21637

Closed kevinsullivan closed 3 years ago

kevinsullivan commented 4 years ago

Description

yarn build yarn run v1.22.0 $ gatsby build success open and validate gatsby-configs - 0.176s success load plugins - 0.947s success onPreInit - 0.030s success delete html and css files from previous builds - 0.011s success initialize cache - 0.010s success copy gatsby files - 0.084s success onPreBootstrap - 0.022s success createSchemaCustomization - 0.214s warn code block or inline code language not specified in markdown. applying generic code block success source and transform nodes - 18.852s success building schema - 0.747s success createPages - 0.071s success createPagesStatefully - 7.923s success onPreExtractQueries - 0.003s success update schema - 0.065s success extract queries from components - 0.635s success write out requires - 0.017s success write out redirect data - 0.007s success Build manifest and related icons - 0.007s success onPostBootstrap - 0.026s ⠀ info bootstrap finished - 31.994 s ⠀ success Building production JavaScript and CSS bundles - 95.872s success Rewriting compilation hashes - 0.021s success run queries - 97.171s - 238/238 2.45/s [ ] 0.001 s 0/236 0% Building static HTML for pages Using browser-only version of superagent in non-browser environment failed Building static HTML for pages - 19.990s

ERROR #95313

Building static HTML failed for path "/book/auto/sections/"

See our docs page for more info on this error: https://gatsby.dev/debug-html

Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. d-172-25-98-45:mission-dm sullivan$ Component Lean was not imported, exported, or provided by MDXProvider as global scope Component Lean was not imported, exported, or provided by MDXProvider as global scope Component Lean was not imported, exported, or provided by MDXProvider as global scope Component Lean was not imported, exported, or provided by MDXProvider as global scope Component Lean was not imported, exported, or provided by MDXProvider as global scope events.js:298 throw er; // Unhandled 'error' event ^

Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at process.target.send (internal/child_process.js:684:16) at reportSuccess (/Users/sullivan/Projects/mission-dm/node_modules/jest-worker/build/workers/processChild.js:83:11) at tryCatcher (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:729:18) at Promise._fulfill (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:673:18) at MappingPromiseArray.PromiseArray._resolve (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise_array.js:127:19) at MappingPromiseArray._promiseFulfilled (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/map.js:108:18) at Promise._settlePromise (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:609:26) at Promise._settlePromise0 (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/async.js:102:5) Emitted 'error' event on process instance at: at internal/child_process.js:688:35 at processTicksAndRejections (internal/process/task_queues.js:79:11) { code: 'ERR_IPC_CHANNEL_CLOSED' }

Steps to reproduce

The repo is not public at this time. I could give Gatsby devs access for debugging. I'm hoping my config files will be enough to suggest a diagnosis and remediation.

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

Expected result

What should happen? System should build.

Actual result

What happened. It doesn't. Here's the error:

yarn build
yarn run v1.22.0
$ gatsby build
success open and validate gatsby-configs - 0.176s
success load plugins - 0.947s
success onPreInit - 0.030s
success delete html and css files from previous builds - 0.011s
success initialize cache - 0.010s
success copy gatsby files - 0.084s
success onPreBootstrap - 0.022s
success createSchemaCustomization - 0.214s
warn code block or inline code language not specified in markdown. applying generic code block
success source and transform nodes - 18.852s
success building schema - 0.747s
success createPages - 0.071s
success createPagesStatefully - 7.923s
success onPreExtractQueries - 0.003s
success update schema - 0.065s
success extract queries from components - 0.635s
success write out requires - 0.017s
success write out redirect data - 0.007s
success Build manifest and related icons - 0.007s
success onPostBootstrap - 0.026s
⠀
info bootstrap finished - 31.994 s
⠀
success Building production JavaScript and CSS bundles - 95.872s
success Rewriting compilation hashes - 0.021s
success run queries - 97.171s - 238/238 2.45/s
[                            ]   0.001 s 0/236 0% Building static HTML for pages
Using browser-only version of superagent in non-browser environment
failed Building static HTML for pages - 19.990s

 ERROR #95313 

Building static HTML failed for path "/book/auto/sections/"

See our docs page for more info on this error: https://gatsby.dev/debug-html

  Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the   full message or use the non-minified dev environment for full errors and additional helpful warnings.

  - react-dom-server.node.production.min.js:48 a.b.render
    [mission-dm]/[react-dom]/cjs/react-dom-server.node.production.min.js:48:37

  - react-dom-server.node.production.min.js:44 a.b.read
    [mission-dm]/[react-dom]/cjs/react-dom-server.node.production.min.js:44:18

  - react-dom-server.node.production.min.js:54 renderToString
    [mission-dm]/[react-dom]/cjs/react-dom-server.node.production.min.js:54:364

  - render-page.js:754 Module.default
    /Users/sullivan/Projects/mission-dm/public/render-page.js:754:28

  - render-html.js:35 
    [mission-dm]/[gatsby]/dist/utils/worker/render-html.js:35:36

  - debuggability.js:384 Promise._execute
    [mission-dm]/[bluebird]/js/release/debuggability.js:384:9

  - promise.js:518 Promise._resolveFromExecutor
    [mission-dm]/[bluebird]/js/release/promise.js:518:18

  - promise.js:103 new Promise
    [mission-dm]/[bluebird]/js/release/promise.js:103:10

  - render-html.js:31 
    [mission-dm]/[gatsby]/dist/utils/worker/render-html.js:31:37

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

  - map.js:68 MappingPromiseArray._promiseFulfilled
    [mission-dm]/[bluebird]/js/release/map.js:68:38

  - promise_array.js:115 MappingPromiseArray.PromiseArray._iterate
    [mission-dm]/[bluebird]/js/release/promise_array.js:115:31

  - promise_array.js:79 MappingPromiseArray.init
    [mission-dm]/[bluebird]/js/release/promise_array.js:79:10

  - map.js:37 MappingPromiseArray._asyncInit
    [mission-dm]/[bluebird]/js/release/map.js:37:10

  - async.js:97 _drainQueueStep
    [mission-dm]/[bluebird]/js/release/async.js:97:12

  - async.js:86 _drainQueue
    [mission-dm]/[bluebird]/js/release/async.js:86:9

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
d-172-25-98-45:mission-dm sullivan$ Component Lean was not imported, exported, or provided by MDXProvider as global scope
Component Lean was not imported, exported, or provided by MDXProvider as global scope
Component Lean was not imported, exported, or provided by MDXProvider as global scope
Component Lean was not imported, exported, or provided by MDXProvider as global scope
Component Lean was not imported, exported, or provided by MDXProvider as global scope
events.js:298
      throw er; // Unhandled 'error' event
      ^

Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at process.target.send (internal/child_process.js:684:16)
    at reportSuccess (/Users/sullivan/Projects/mission-dm/node_modules/jest-worker/build/workers/processChild.js:83:11)
    at tryCatcher (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:673:18)
    at MappingPromiseArray.PromiseArray._resolve (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise_array.js:127:19)
    at MappingPromiseArray._promiseFulfilled (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/map.js:108:18)
    at Promise._settlePromise (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:609:26)
    at Promise._settlePromise0 (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/sullivan/Projects/mission-dm/node_modules/bluebird/js/release/async.js:102:5)
Emitted 'error' event on process instance at:
    at internal/child_process.js:688:35
    at processTicksAndRejections (internal/process/task_queues.js:79:11) {
  code: 'ERR_IPC_CHANNEL_CLOSED'
}

Environment

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

System: OS: macOS 10.15.1 CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 13.8.0 - /usr/local/bin/node Yarn: 1.22.0 - /usr/local/bin/yarn npm: 6.13.7 - /usr/local/bin/npm Languages: Python: 2.7.16 - /usr/local/bin/python Browsers: Chrome: 80.0.3987.116 Firefox: 72.0.2 Safari: 13.0.3 npmPackages: gatsby: ^2.18.6 => 2.18.17 gatsby-cli: ^2.8.22 => 2.8.22 gatsby-image: ^2.2.34 => 2.2.37 gatsby-plugin-antd: ^2.1.0 => 2.1.0 gatsby-plugin-breadcrumb: ^7.0.0 => 7.0.0 gatsby-plugin-catch-links: ^2.1.19 => 2.1.21 gatsby-plugin-emotion: ^4.1.16 => 4.1.18 gatsby-plugin-eslint: ^2.0.8 => 2.0.8 gatsby-plugin-feed-mdx: ^1.0.0 => 1.0.0 gatsby-plugin-google-analytics: ^2.1.33 => 2.1.33 gatsby-plugin-manifest: ^2.2.34 => 2.2.34 gatsby-plugin-mdx: ^1.0.64 => 1.0.64 gatsby-plugin-nprogress: ^2.1.15 => 2.1.17 gatsby-plugin-offline: ^3.0.30 => 3.0.30 gatsby-plugin-react-helmet: ^3.1.18 => 3.1.18 gatsby-plugin-reason: ^2.0.1 => 2.0.1 gatsby-plugin-sass: ^2.1.26 => 2.1.26 gatsby-plugin-sharp: ^2.3.4 => 2.3.10 gatsby-plugin-sitemap: ^2.2.24 => 2.2.24 gatsby-plugin-styled-components: ^3.1.16 => 3.1.16 gatsby-plugin-theme-ui: ^0.2.53 => 0.2.53 gatsby-plugin-tslint: ^0.0.2 => 0.0.2 gatsby-plugin-twitter: ^2.1.17 => 2.1.17 gatsby-plugin-typescript: ^2.1.23 => 2.1.23 gatsby-plugin-typography: ^2.3.18 => 2.3.20 gatsby-plugin-webpack-bundle-analyzer: ^1.0.5 => 1.0.5 gatsby-remark-copy-linked-files: ^2.1.33 => 2.1.33 gatsby-remark-embed-video: ^2.0.1 => 2.0.1 gatsby-remark-embed-youtube: ^0.0.7 => 0.0.7 gatsby-remark-external-links: ^0.0.4 => 0.0.4 gatsby-remark-graphviz: ^1.1.21 => 1.1.21 gatsby-remark-images: ^3.1.34 => 3.1.39 gatsby-remark-katex: ^3.1.20 => 3.1.20 gatsby-remark-mathjax: ^1.0.0 => 1.0.0 gatsby-remark-prismjs: ^3.3.25 => 3.3.28 gatsby-remark-responsive-iframe: ^2.2.30 => 2.2.30 gatsby-remark-slug: ^0.1.0 => 0.1.0 gatsby-remark-smartypants: ^2.1.19 => 2.1.19 gatsby-source-filesystem: ^2.1.39 => 2.1.43 gatsby-source-graphql: ^2.1.29 => 2.1.29 gatsby-transformer-remark: ^2.6.45 => 2.6.45 gatsby-transformer-sharp: ^2.3.6 => 2.3.9 npmGlobalPackages: gatsby-cli: 2.8.22

freiksenet commented 4 years ago

It's really hard to debug this without code, but one possible problem could be that component Lean isn't added to MdxProvider in your code.

Also pinging @johno

johno commented 4 years ago

It's also possible that you have a component that is referencing window which causes an error during the production building of html. Could this be happening?

kevinsullivan commented 4 years ago

Thank you, folks. First, I've made the repo public. It lives on my own GitLab instance, at https://logicpipeline.com/engineeringlogic/mission-dm.git. Use a recursive clone, as there's a submodule that needs to be cloned as well. You should be able to clone it from here: https://logicpipeline.com/engineeringlogic/mission-dm.git

Second, it's true that I'm not using MDXProvider, but it was working for a long time, albeit giving those errors about component Lean not being provided, etc.

Third, I don't believe I'm using "window" anywhere in the project (anymore).

kevinsullivan commented 4 years ago

Is there a way for an end-user of Gatsby to debug this sort of problem? There's really no hint as to what's going wrong.

johno commented 4 years ago

Thanks for providing a reproduction @kevinsullivan! I was able to clone it locally, though when running yarn build I never saw an error. Did you happen to fix the page in question?

Is there a way for an end-user of Gatsby to debug this sort of problem? There's really no hint as to what's going wrong.

It appears that the error is a component that is being passed to React that isn't a function or string.

kevinsullivan commented 4 years ago

Argh. That's my fault. Let me push a branch that's producing the error. I will do this shortly and will let you know when it's done. I'm sorry about that. Give me a bit. I simply hadn't pushed the broken build.

On Tue, Feb 25, 2020 at 10:02 AM John Otander notifications@github.com wrote:

Thanks for providing a reproduction @kevinsullivan https://github.com/kevinsullivan! I was able to clone it locally, though when running yarn build I never saw an error. Did you happen to fix the page in question?

Is there a way for an end-user of Gatsby to debug this sort of problem? There's really no hint as to what's going wrong.

It appears that the error is a component that is being passed to React that isn't a function or string https://reactjs.org/docs/error-decoder.html/?invariant=130.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gatsbyjs/gatsby/issues/21637?email_source=notifications&email_token=AAVEX5KJZJJNBS6TDX64EODREUXIXA5CNFSM4KY4NU22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4JKII#issuecomment-590910753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVEX5JPPTQVMHWMPXZTJQ3REUXIXANCNFSM4KY4NU2Q .

kevinsullivan commented 4 years ago

Ok, please pull then checkout the branch, "broken" and retry. --Kevin

On Tue, Feb 25, 2020 at 10:24 AM Kevin Sullivan sullivan.kevinj@gmail.com wrote:

Argh. That's my fault. Let me push a branch that's producing the error. I will do this shortly and will let you know when it's done. I'm sorry about that. Give me a bit. I simply hadn't pushed the broken build.

On Tue, Feb 25, 2020 at 10:02 AM John Otander notifications@github.com wrote:

Thanks for providing a reproduction @kevinsullivan https://github.com/kevinsullivan! I was able to clone it locally, though when running yarn build I never saw an error. Did you happen to fix the page in question?

Is there a way for an end-user of Gatsby to debug this sort of problem? There's really no hint as to what's going wrong.

It appears that the error is a component that is being passed to React that isn't a function or string https://reactjs.org/docs/error-decoder.html/?invariant=130.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gatsbyjs/gatsby/issues/21637?email_source=notifications&email_token=AAVEX5KJZJJNBS6TDX64EODREUXIXA5CNFSM4KY4NU22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4JKII#issuecomment-590910753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVEX5JPPTQVMHWMPXZTJQ3REUXIXANCNFSM4KY4NU2Q .

adonig commented 4 years ago

I get this error since upgrading. What's the best way to fix it? Should I go back to 2.19.35 or will this get fixed soon?

EDIT: I've upgraded to 2.20.2 and now I get a different error:

info bootstrap finished - 2096.414 s
⠀
failed Building production JavaScript and CSS bundles - 1.183s

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

/Users/asd/Projects/buybags/frontend/.cache/production-app.js: Unknown helper createSuper

File: .cache/production-app.js

Anyone has an idea?

EDIT2: The above error went away when I deleted node_modules and package-lock.json and did a npm install. The previous error Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed still remains though.

EDIT3: The error went away and I'm not 100% sure why, but it might be related to the data I use to populate the page.

haase1020 commented 3 years ago

I am getting the same error when I run gatsby clean && gatsby build. My repo is https://github.com/haase1020/mandi-haase-portfolio

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s 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. 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! 💪💜

github-actions[bot] commented 3 years ago

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. 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 again for being part of the Gatsby community! 💪💜