Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Reducers may not dispatch actions #20082

Closed
bre7 opened this issue Dec 11, 2019 · 48 comments
Closed

Error: Reducers may not dispatch actions #20082

bre7 opened this issue Dec 11, 2019 · 48 comments

Comments

@bre7
Copy link

bre7 commented Dec 11, 2019

Description

After either develop or build is run, the following error message is displayed:

SHOW ERROR MSG

gatsby develop

ERROR

UNHANDLED REJECTION Reducers may not dispatch actions.

Error: Reducers may not dispatch actions.

  • redux.js:213 dispatch
    [demo6_gatsby]/[redux]/lib/redux.js:213:13

  • index.js:58
    [demo6_gatsby]/[gatsby]/dist/redux/index.js:58:88

  • index.js:14 Object.dispatch
    [demo6_gatsby]/[redux-thunk]/lib/index.js:14:16

  • index.js:47 dispatch
    [demo6_gatsby]/[gatsby-cli]/lib/reporter/redux/index.js:47:11

  • redux.js:481 Object.createLog
    [demo6_gatsby]/[redux]/lib/redux.js:481:12

  • index.js:67 Object.log
    [demo6_gatsby]/[gatsby-cli]/lib/reporter/index.js:67:53

  • index.js:459 Object.console.log
    [demo6_gatsby]/[gatsby-cli]/lib/reporter/index.js:459:37

  • config.js:20 module.exports
    [demo6_gatsby]/[gatsby]/dist/redux/reducers/config.js:20:19

  • redux.js:464 combination
    [demo6_gatsby]/[redux]/lib/redux.js:464:29

  • redux.js:218 dispatch
    [demo6_gatsby]/[redux]/lib/redux.js:218:22

  • index.js:58
    [demo6_gatsby]/[gatsby]/dist/redux/index.js:58:88

  • index.js:14 Object.dispatch
    [demo6_gatsby]/[redux-thunk]/lib/index.js:14:16

  • index.js:168 module.exports
    [demo6_gatsby]/[gatsby]/dist/bootstrap/index.js:168:9

  • develop.js:419 async module.exports
    [demo6_gatsby]/[gatsby]/dist/commands/develop.js:419:7

not finished open and validate gatsby-configs - 0.161s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Closest issue is https://github.com/reduxjs/redux-thunk/issues/122 but not sure it applies to my project

Steps to reproduce

gatsby develop

Expected result

Site should be built

Actual result

Error message is displayed

Environment

SHOW CONTENT

System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7 CPU @ 3.50GHz
Binaries:
Node: 13.0.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.13
Browsers:
Edge: 44.18362.449.0
npmPackages:
gatsby: ^2.18.3 => 2.18.11
gatsby-background-image: ^0.9.7 => 0.9.11
gatsby-image: ^2.2.33 => 2.2.36
gatsby-plugin-catch-links: ^2.1.18 => 2.1.21
gatsby-plugin-facebook-pixel: ^1.0.3 => 1.0.3
gatsby-plugin-google-analytics: ^2.1.29 => 2.1.31
gatsby-plugin-manifest: ^2.2.29 => 2.2.33
gatsby-plugin-offline: ^3.0.23 => 3.0.29
gatsby-plugin-react-helmet: ^3.1.15 => 3.1.18
gatsby-plugin-remove-console: ^0.0.2 => 0.0.2
gatsby-plugin-robots-txt: ^1.5.0 => 1.5.0
gatsby-plugin-sass: ^2.1.24 => 2.1.26
gatsby-plugin-sharp: ^2.3.3 => 2.3.7
gatsby-plugin-sitemap: ^2.2.22 => 2.2.24
gatsby-source-filesystem: ^2.1.38 => 2.1.42
gatsby-transformer-sharp: ^2.3.5 => 2.3.9

@bre7
Copy link
Author

bre7 commented Dec 12, 2019

It was an issue in gatsby-config.js :S Silent warning ?

@bre7 bre7 closed this as completed Dec 12, 2019
@mukund-v
Copy link

how did you end up fixing this?

@bre7
Copy link
Author

bre7 commented Dec 22, 2019

The real error message wasn't being displayed on the console for some reason.
I attached the debugger (using WebStorm) and added a breakpoint on that Exception and found the error was about a syntax issue, unrelated to Redux.

@mcyleung
Copy link

I had the exact same issue. It's unrelated to redux but it's related to gatsby-config.js not being configured properly

@mukund-v
Copy link

Thank you guys. Think I figured it out

@Grsmto
Copy link

Grsmto commented Feb 13, 2020

Here it is, it might save you 4h of debugging:

Make sure the siteUrl in your gatsby-config.js is correct. Mine was missing the http:// and for some misterious reason I had this error output.

@stevus
Copy link

stevus commented Mar 14, 2020

@Grsmto also had the same issue and adding "http://" to `siteUrl' fixed it. Feels like a Gatsby bug.

@wesbos
Copy link
Contributor

wesbos commented May 12, 2020

For me it was changing siteMetaData to siteMetadata :)

@barbalex
Copy link

barbalex commented Jul 2, 2020

I am suddenly getting this when updating gatsby from v2.20.36 to v2.13.16.

I have absolutely no idea what could be wrong - after all: gastby-config.js has not changed. Only the gatsby version.

@wesbos
Copy link
Contributor

wesbos commented Jul 2, 2020

post your gatsby-config

@barbalex
Copy link

barbalex commented Jul 2, 2020

The error is a bit different in that it refers to gatsby-plugin-offline:

 ERROR #11321  PLUGIN                                                                          
                                                                                               
"gatsby-plugin-offline" threw an error while running the createPages lifecycle:                
                                                                                               
Reducers may not dispatch actions.                                                             
                                                                                               
                                                                                               
                                                                                               
  Error: Reducers may not dispatch actions.                                                    
                                                                                               
  - redux.js:214 dispatch                                                                      
    [vermehrung]/[redux]/lib/redux.js:214:13                                                   
                                                                                               
  - index.js:64                                                                                
    [vermehrung]/[gatsby]/dist/redux/index.js:64:88                                            
                                                                                               
  - index.js:14 Object.dispatch                                                                
    [vermehrung]/[redux-thunk]/lib/index.js:14:16                                              
                                                                                               
  - index.js:45 dispatch                                                                       
    [vermehrung]/[gatsby-cli]/lib/reporter/redux/index.js:45:9                                 
                                                                                               
  - redux.js:483 Object.createLog                                                              
    [vermehrung]/[redux]/lib/redux.js:483:12                                                   
                                                                                               
  - reporter.js:168 Reporter.warn                                                              
    [vermehrung]/[gatsby-cli]/lib/reporter/reporter.js:168:41                                  
                                                                                               
  - patch-console.js:22 Object.console.warn                                                    
    [vermehrung]/[gatsby-cli]/lib/reporter/patch-console.js:22:14                              
                                                                                               
  - utils.js:449 Object.warn                                                                   
    [vermehrung]/[xstate]/lib/utils.js:449:26                                                  
                                                                                               
  - StateNode.js:1313                                                                          
    [vermehrung]/[xstate]/lib/StateNode.js:1313:29                                             
                                                                                               
  - Array.map                                                                                  
                                                                                               
  - StateNode.js:1311 StateNode.formatTransitions                                              
    [vermehrung]/[xstate]/lib/StateNode.js:1311:18                                             
                                                                                               
  - StateNode.js:321 StateNode.get [as transitions]                                            
    [vermehrung]/[xstate]/lib/StateNode.js:321:51                                              
                                                                                               
  - StateNode.js:296 StateNode.get [as on]                                                     
    [vermehrung]/[xstate]/lib/StateNode.js:296:36                                              
                                                                                               
  - StateNode.js:230                                                                           
    [vermehrung]/[xstate]/lib/StateNode.js:230:93                                              
                                                                                               
  - Array.forEach                                                                              
                                                                                               
  - StateNode.js:230 StateNode._init                                                           
    [vermehrung]/[xstate]/lib/StateNode.js:230:45                                              
                                                                                               
                                                                                               
failed createPages - 0.094s                                                                    
error Command failed with exit code 1.                                                         

So maybe I should create a new issue.

Here is my gatsby-config:

module.exports = {
  siteMetadata: {
    title: 'Vermehrung v0.41.1',
  },
  plugins: [
    {
      resolve: 'gatsby-plugin-eslint',
      options: {
        test: /\.js$|\.jsx$/,
        exclude: /(node_modules|cache|public|docs)/,
        options: {
          emitWarning: true,
          failOnError: false,
        },
      },
    },
    {
      resolve: 'gatsby-plugin-create-client-paths',
      options: { prefixes: [`/Vermehrung/*`] },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'images',
        path: `${__dirname}/src/images/`,
      },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        path: `${__dirname}/src/docs`,
        name: 'docs-pages',
      },
    },
    'gatsby-plugin-sharp',
    'gatsby-transformer-sharp',
    {
      resolve: 'gatsby-plugin-web-font-loader',
      options: {
        google: {
          families: ['Roboto', 'Roboto Mono'],
        },
      },
    },
    {
      resolve: 'gatsby-plugin-typography',
      options: {
        pathToConfigModule: './src/utils/typography.js',
      },
    },
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-styled-components',
    {
      resolve: 'gatsby-plugin-manifest',
      options: {
        scope: '/',
        name: 'vermehrung.ch',
        short_name: 'vermehrung',
        start_url: '/',
        background_color: '#2e0c58',
        theme_color: '#2e0c58',
        display: 'standalone',
        icon: 'src/images/seedling.png',
        include_favicon: true,
      },
    },
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        gfm: true,
        commonmark: false,
        footnotes: true,
        pedantic: false,
        excerpt_separator: '<!-- end -->',
        plugins: [
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 2000,
              wrapperStyle: 'margin-left: 0;',
              linkImagesToOriginal: false,
            },
          },
          {
            resolve: 'gatsby-remark-autolink-headers',
            options: {
              offsetY: '64',
            },
          },
          {
            resolve: 'gatsby-remark-emojis',
            options: {
              // Deactivate the plugin globally (default: true)
              active: true,
              // Add a custom css class
              class: 'emoji-icon',
              // Select the size (available size: 16, 24, 32, 64)
              size: 32,
              // Add custom styles
              styles: {
                display: 'inline',
                margin: '0',
                'margin-top': '-3px',
                position: 'relative',
                top: '3px',
                width: '20px',
              },
            },
          },
          {
            resolve: 'gatsby-remark-external-links',
            options: {
              target: '_self',
              rel: 'nofollow',
            },
          },
          {
            resolve: `gatsby-remark-images-medium-zoom`, // point!
            options: {
              background: 'rgba(128,128,128,0.5)',
            },
          },
          'gatsby-remark-copy-linked-files',
          {
            resolve: `gatsby-remark-prismjs`,
            options: {
              // Class prefix for <pre> tags containing syntax highlighting;
              // defaults to 'language-' (e.g. <pre class="language-js">).
              // If your site loads Prism into the browser at runtime,
              // (e.g. for use with libraries like react-live),
              // you may use this to prevent Prism from re-processing syntax.
              // This is an uncommon use-case though;
              // If you're unsure, it's best to use the default value.
              classPrefix: 'language-',
              // This is used to allow setting a language for inline code
              // (i.e. single backticks) by creating a separator.
              // This separator is a string and will do no white-space
              // stripping.
              // A suggested value for English speakers is the non-ascii
              // character '›'.
              inlineCodeMarker: null,
              // This lets you set up language aliases.  For example,
              // setting this to '{ sh: "bash" }' will let you use
              // the language "sh" which will highlight using the
              // bash highlighter.
              aliases: {},
              // This toggles the display of line numbers globally alongside the code.
              // To use it, add the following line in gatsby-browser.js
              // right after importing the prism color scheme:
              //  require("prismjs/plugins/line-numbers/prism-line-numbers.css")
              // Defaults to false.
              // If you wish to only show line numbers on certain code blocks,
              // leave false and use the {numberLines: true} syntax below
              showLineNumbers: false,
              // If setting this to true, the parser won't handle and highlight inline
              // code used in markdown i.e. single backtick code like `this`.
              noInlineHighlight: false,
              // This adds a new language definition to Prism or extend an already
              // existing language definition. More details on this option can be
              // found under the header "Add new language definition or extend an
              // existing language" below.
              languageExtensions: [
                {
                  language: 'superscript',
                  extend: 'javascript',
                  definition: {
                    superscript_types: /(SuperType)/,
                  },
                  insertBefore: {
                    function: {
                      superscript_keywords: /(superif|superelse)/,
                    },
                  },
                },
              ],
              // Customize the prompt used in shell output
              // Values below are default
              prompt: {
                user: 'root',
                host: 'localhost',
                global: false,
              },
              // By default the HTML entities <>&'" are escaped.
              // Add additional HTML escapes by providing a mapping
              // of HTML entities and their escape value IE: { '}': '&#123;' }
              escapeEntities: {},
            },
          },
        ],
      },
    },
    'gatsby-plugin-offline',
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        rule: {
          include: /\.inline\.svg$/,
        },
      },
    },
  ],
}

The weird thing is: I did not update gatsby-plugin-offline. Just gatsby itself. gatsby-plugin-offline is v3.2.15.

Meanwhile this error persists when building - even after returning to gatsby v2.20.36. So it seems this project is now broken 😢

@zsolt-p
Copy link

zsolt-p commented Jul 2, 2020

Seeing the same as @barbalex above #20082 (comment)
Neither our Gatsby (2.20.23) nor our Gatsby-plugin-offline version has changed (3.2.0)

@barbalex
Copy link

barbalex commented Jul 2, 2020

I have been stuck on gatsby v2.20.36 for two months now, because of this issue when upgrading: #19618. That seems to be about the same time my gatsby-config changed significantly (one day apart).

I wonder if there is a connection.

@barbalex
Copy link

barbalex commented Jul 2, 2020

When I uncomment gatsby-plugin-offline in gatsby-config.js, the error does not mention gatsby-plugin-offline any more and is similar as others have posted, I think:

$ gatsby clean && gatsby build
info Deleting .cache, public
info Successfully deleted directories
success open and validate gatsby-configs - 0.029s
success load plugins - 0.909s
success onPreInit - 0.009s
success delete html and css files from previous builds - 0.009s
success initialize cache - 0.006s
success copy gatsby files - 0.052s
success onPreBootstrap - 0.007s
success createSchemaCustomization - 0.063s
success source and transform nodes - 0.165s
success building schema - 0.233s

 ERROR #11321  PLUGIN

"gatsby-node.js" threw an error while running the createPages lifecycle:

Reducers may not dispatch actions.



  Error: Reducers may not dispatch actions.

  - redux.js:214 dispatch
    [vermehrung]/[redux]/lib/redux.js:214:13

  - index.js:64
    [vermehrung]/[gatsby]/dist/redux/index.js:64:88

  - index.js:14 Object.dispatch
    [vermehrung]/[redux-thunk]/lib/index.js:14:16

  - index.js:45 dispatch
    [vermehrung]/[gatsby-cli]/lib/reporter/redux/index.js:45:9

  - redux.js:483 Object.createLog
    [vermehrung]/[redux]/lib/redux.js:483:12

  - reporter.js:168 Reporter.warn
    [vermehrung]/[gatsby-cli]/lib/reporter/reporter.js:168:41

  - patch-console.js:22 Object.console.warn
    [vermehrung]/[gatsby-cli]/lib/reporter/patch-console.js:22:14

  - utils.js:449 Object.warn
    [vermehrung]/[xstate]/lib/utils.js:449:26

  - StateNode.js:1313
    [vermehrung]/[xstate]/lib/StateNode.js:1313:29

  - Array.map

  - StateNode.js:1311 StateNode.formatTransitions
    [vermehrung]/[xstate]/lib/StateNode.js:1311:18

  - StateNode.js:321 StateNode.get [as transitions]
    [vermehrung]/[xstate]/lib/StateNode.js:321:51

  - StateNode.js:296 StateNode.get [as on]
    [vermehrung]/[xstate]/lib/StateNode.js:296:36

  - StateNode.js:230
    [vermehrung]/[xstate]/lib/StateNode.js:230:93

  - Array.forEach

  - StateNode.js:230 StateNode._init
    [vermehrung]/[xstate]/lib/StateNode.js:230:45


failed createPages - 0.085s
error Command failed with exit code 1.

@JustFly1984
Copy link

@wardpeet @ I'm getting this error while running build, rolling back to any previous version doesn't help, issue persists:

Screenshot 2020-07-02 21 03 02

running in gatsby develop -S is working, affected only gatsby build pipeline.
Everything started after I have tried to update 2.23.16, but install crashing with dependency error, it is trying to install unpublished version of typescript plugin. Now I see that 2.23.16 disappeared from npm, but 2.23.15 does not help

@barbalex
Copy link

barbalex commented Jul 2, 2020

but install crashing with dependency error, it is trying to install unpublished version of typescript plugin

Same problem here. I have reverted to gatsby v2.20.36 but the actual issue persists

@gabrielgiordan
Copy link
Contributor

gabrielgiordan commented Jul 2, 2020

I'm also having the same issue after upgrading gatsby, I think it's not related to gatsby-config, because it seems valid. Any clue on this?

~/Git/gabrielgiordano.com master* 8s  yarn build                                                                                                  11:07:00
yarn run v1.22.4
$ gatsby build
success open and validate gatsby-configs - 0.083s
success load plugins - 4.766s
success onPreInit - 0.047s
success delete html and css files from previous builds - 0.014s
success initialize cache - 0.007s
success copy gatsby files - 0.195s
success onPreBootstrap - 0.017s
success createSchemaCustomization - 0.007s
success source and transform nodes - 5.795s
success building schema - 0.455s

 ERROR #11321  PLUGIN

"gatsby-plugin-offline" threw an error while running the createPages lifecycle:

Reducers may not dispatch actions.



  Error: Reducers may not dispatch actions.

  - redux.js:214 dispatch
    [gabrielgiordano.com]/[redux]/lib/redux.js:214:13

  - index.js:67
    [gabrielgiordano.com]/[gatsby]/dist/redux/index.js:67:88

  - index.js:14 Object.dispatch
    [gabrielgiordano.com]/[redux-thunk]/lib/index.js:14:16

  - index.js:45 dispatch
    [gabrielgiordano.com]/[gatsby-cli]/lib/reporter/redux/index.js:45:9

  - redux.js:483 Object.createLog
    [gabrielgiordano.com]/[redux]/lib/redux.js:483:12

  - reporter.js:168 Reporter.warn
    [gabrielgiordano.com]/[gatsby-cli]/lib/reporter/reporter.js:168:41

  - patch-console.js:22 Object.console.warn
    [gabrielgiordano.com]/[gatsby-cli]/lib/reporter/patch-console.js:22:14

  - utils.js:449 Object.warn
    [gabrielgiordano.com]/[xstate]/lib/utils.js:449:26

  - StateNode.js:1313
    [gabrielgiordano.com]/[xstate]/lib/StateNode.js:1313:29

  - Array.map

  - StateNode.js:1311 StateNode.formatTransitions
    [gabrielgiordano.com]/[xstate]/lib/StateNode.js:1311:18

  - StateNode.js:321 StateNode.get [as transitions]
    [gabrielgiordano.com]/[xstate]/lib/StateNode.js:321:51

  - StateNode.js:296 StateNode.get [as on]
    [gabrielgiordano.com]/[xstate]/lib/StateNode.js:296:36

  - StateNode.js:230
    [gabrielgiordano.com]/[xstate]/lib/StateNode.js:230:93

  - Array.forEach

  - StateNode.js:230 StateNode._init
    [gabrielgiordano.com]/[xstate]/lib/StateNode.js:230:45


failed createPages - 0.058s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@alkiko
Copy link

alkiko commented Jul 2, 2020

Also started seing this today.

Upgrading or downgrading gatsby does not appear to have any effect. Neither does gatsby cache clean or yarn cache clean.

➜  site git:(develop) yarn run build
yarn run v1.22.4
$ gatsby build
Using environment config: 'production'
success open and validate gatsby-configs - 0.106s
success load plugins - 0.897s
success onPreInit - 0.016s
success delete html and css files from previous builds - 0.020s
success initialize cache - 0.027s
success copy gatsby files - 0.078s
success onPreBootstrap - 0.669s
success createSchemaCustomization - 0.013s
success source and transform nodes - 2.416s
success building schema - 1.591s

 ERROR #11321  PLUGIN

"gatsby-theme-cinemataztic-cms" threw an error while running the createPages lifecycle:

Reducers may not dispatch actions.



  Error: Reducers may not dispatch actions.
  
  - redux.js:214 dispatch
    [site]/[redux]/lib/redux.js:214:13
  
  - index.js:67 
    [site]/[gatsby]/dist/redux/index.js:67:88
  
  - index.js:14 Object.dispatch
    [site]/[redux-thunk]/lib/index.js:14:16
  
  - index.js:45 dispatch
    [site]/[gatsby-cli]/lib/reporter/redux/index.js:45:9
  
  - redux.js:483 Object.createLog
    [site]/[redux]/lib/redux.js:483:12
  
  - reporter.js:168 Reporter.warn
    [site]/[gatsby-cli]/lib/reporter/reporter.js:168:41
  
  - patch-console.js:22 Object.console.warn
    [site]/[gatsby-cli]/lib/reporter/patch-console.js:22:14
  
  - utils.js:449 Object.warn
    [site]/[xstate]/lib/utils.js:449:26
  
  - StateNode.js:1313 
    [site]/[xstate]/lib/StateNode.js:1313:29
  
  - Array.map
  
  - StateNode.js:1311 StateNode.formatTransitions
    [site]/[xstate]/lib/StateNode.js:1311:18
  
  - StateNode.js:321 StateNode.get [as transitions]
    [site]/[xstate]/lib/StateNode.js:321:51
  
  - StateNode.js:296 StateNode.get [as on]
    [site]/[xstate]/lib/StateNode.js:296:36
  
  - StateNode.js:230 
    [site]/[xstate]/lib/StateNode.js:230:93
  
  - Array.forEach
  
  - StateNode.js:230 StateNode._init
    [site]/[xstate]/lib/StateNode.js:230:45
  

failed createPages - 0.130s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@barbalex
Copy link

barbalex commented Jul 2, 2020

Yep, I have tried upgrading/downgrading/removing some plugins/gatsby cache clean/yarn clean/completely new install, all several times. Still happens though sometimes mentions gatsby-plugin-offline, sometimes only gatsby-node.js.

@barbalex
Copy link

barbalex commented Jul 2, 2020

Meanwhile I can't even develop any more without this issue preventing it 😢

@mstingl
Copy link

mstingl commented Jul 2, 2020

We just had the same issue.
After downgrading gatsby-cli to version 2.12.54 this error is no longer raised.

@JustFly1984
Copy link

I've tested on another project, has updated everything, except latest gatsby 2.23.15, and build was working. As soon as I updated gatsby to 2.23.15, build has broken.
I've compared yarn.lock

Screenshot 2020-07-02 21 32 23

@PierreCrb
Copy link

We just had the same issue.
After downgrading gatsby-cli to version 2.12.54 this error is no longer raised.

Works for me thanks ! ✅ ❤️

@truumahn
Copy link

truumahn commented Jul 2, 2020

Might be related to: #25466

@gabrielgiordan
Copy link
Contributor

We just had the same issue.
After downgrading gatsby-cli to version 2.12.54 this error is no longer raised.

Also worked for me, thanks mate!

@barbalex
Copy link

barbalex commented Jul 2, 2020

Downgrading gatsby-cli from 2.12.55 to 2.12.54 resulted in my case in this error when running yarn build:

alexa@PCA C:\Users\alexa\vermehrung
$ yarn build
yarn run v1.22.4
$ gatsby clean && gatsby build
success open and validate gatsby-configs - 0.036s
success load plugins - 0.961s
success onPreInit - 0.008s
success delete html and css files from previous builds - 0.009s
success initialize cache - 0.007s
success copy gatsby files - 0.055s
success onPreBootstrap - 0.009s
success createSchemaCustomization - 0.045s
success source and transform nodes - 0.167s
success building schema - 0.250s
warn Warning: Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. Please check the `on` configuration for
warn Warning: Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. Please check the `on` configuration for
success createPages - 0.057s
warn Warning: Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. Please check the `on` configuration for
warn Warning: Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. Please check the `on` configuration for
warn Warning: Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. Please check the `on` configuration for
warn Warning: Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. Please check the `on` configuration for
success createPagesStatefully - 0.086s
success updating schema - 0.019s
success onPreExtractQueries - 0.002s
success extract queries from components - 1.346s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.066s
success onPostBootstrap - 0.074s
info bootstrap finished - 5.736s
success run static queries - 0.057s - 2/2 35.04/s
success run page queries - 1.336s - 35/35 26.20/s
success write out requires - 0.014s
success Building production JavaScript and CSS bundles - 138.734s
success Rewriting compilation hashes - 0.006s
[============================]   140.577 s 31/31 100% Generating image thumbnails
[                            ]   0.001 s 0/35 0% Building static HTML for pages
C:\Users\alexa\vermehrung\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
        throw ex;
        ^

Error: Cannot find module 'core-js/es6/math'
Require stack:
- C:\Users\alexa\vermehrung\node_modules\gatsby\dist\utils\webpack.config.js
- C:\Users\alexa\vermehrung\node_modules\gatsby\dist\commands\build-html.js
- C:\Users\alexa\vermehrung\node_modules\gatsby\dist\commands\build.js
- C:\Users\alexa\vermehrung\node_modules\gatsby-cli\lib\create-cli.js
- C:\Users\alexa\vermehrung\node_modules\gatsby-cli\lib\index.js
- C:\Users\alexa\vermehrung\node_modules\gatsby-cli\cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
    at Function.resolve (internal/modules/cjs/helpers.js:79:19)
    at isExternal (C:\Users\alexa\vermehrung\node_modules\gatsby\dist\utils\webpack.config.js:578:31)
    at config.externals (C:\Users\alexa\vermehrung\node_modules\gatsby\dist\utils\webpack.config.js:589:24)
    at handleExternals (C:\Users\alexa\vermehrung\node_modules\webpack\lib\ExternalModuleFactoryPlugin.js:78:17)
    at next (C:\Users\alexa\vermehrung\node_modules\webpack\lib\ExternalModuleFactoryPlugin.js:66:9)
    at handleExternals (C:\Users\alexa\vermehrung\node_modules\webpack\lib\ExternalModuleFactoryPlugin.js:71:7)
    at C:\Users\alexa\vermehrung\node_modules\webpack\lib\ExternalModuleFactoryPlugin.js:101:5
    at C:\Users\alexa\vermehrung\node_modules\webpack\lib\NormalModuleFactory.js:400:5
    at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (C:\Users\alexa\vermehrung\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:18:1)
    at NormalModuleFactory.create (C:\Users\alexa\vermehrung\node_modules\webpack\lib\NormalModuleFactory.js:381:28)
    at C:\Users\alexa\vermehrung\node_modules\webpack\lib\Compilation.js:897:14
    at Semaphore.acquire (C:\Users\alexa\vermehrung\node_modules\webpack\lib\util\Semaphore.js:29:4)
    at asyncLib.forEach.err.stack (C:\Users\alexa\vermehrung\node_modules\webpack\lib\Compilation.js:895:15)
    at arrayEach (C:\Users\alexa\vermehrung\node_modules\neo-async\async.js:2405:9)
    at Object.each (C:\Users\alexa\vermehrung\node_modules\neo-async\async.js:2846:9) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\alexa\\vermehrung\\node_modules\\gatsby\\dist\\utils\\webpack.config.js',
    'C:\\Users\\alexa\\vermehrung\\node_modules\\gatsby\\dist\\commands\\build-html.js',
    'C:\\Users\\alexa\\vermehrung\\node_modules\\gatsby\\dist\\commands\\build.js',
    'C:\\Users\\alexa\\vermehrung\\node_modules\\gatsby-cli\\lib\\create-cli.js',
    'C:\\Users\\alexa\\vermehrung\\node_modules\\gatsby-cli\\lib\\index.js',
    'C:\\Users\\alexa\\vermehrung\\node_modules\\gatsby-cli\\cli.js'
  ]
}
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I tried downgrading further to v2.12.52 but the error remains.

Actually: this could be related to #15601.

@JustFly1984
Copy link

JustFly1984 commented Jul 2, 2020

@wardpeet @barbalex
Ok, hear me out: I solved build issue with 3 steps:

  • Found a commit before updating gatsby(2.23.14), copied yarn.lock, and replaced in current commit.
  • in package.json added to resolutions "babel-plugin-remove-graphql-queries": "2.9.9"
{
  "resolutions": {
    "babel-plugin-remove-graphql-queries": "2.9.9"
  },
}

and just replaced gatsby packages to this versions:

"gatsby": "2.23.15",
    "gatsby-plugin-catch-links": "2.3.9",
    "gatsby-plugin-google-fonts": "1.0.1",
    "gatsby-plugin-minify-classnames": "0.2.0",
    "gatsby-plugin-no-sourcemaps": "2.2.0",
    "gatsby-plugin-offline": "3.2.15",
    "gatsby-plugin-purgecss": "5.0.0",
    "gatsby-plugin-react-helmet": "3.3.8",
    "gatsby-plugin-robots-txt": "1.5.1",
    "gatsby-plugin-root-import": "2.0.5",
    "gatsby-plugin-sitemap": "2.4.9",
    "gatsby-plugin-sri": "1.1.0",
    "gatsby-plugin-typescript": "2.4.10",
    "gatsby-plugin-webpack-bundle-analyser-v2": "1.1.10",

and only after that run gatsby build successfully

after that I have updated every gatsby plugin, and build did not break

It did worked for 2 projects.

@JustFly1984
Copy link

JustFly1984 commented Jul 2, 2020

2.23.17 is working correctly with all packages updated to latest versions and without pinning resolutions "babel-plugin-remove-graphql-queries": "2.9.9"!

@barbalex
Copy link

barbalex commented Jul 2, 2020

With:

  • gatsby v2.23.17
  • gatsby-plugin-offline v3.2.16
  • gatsby-cli v2.12.56

dev mode works 🚀

but building errors:

$ yarn build
yarn run v1.22.4
$ gatsby clean && gatsby build
info Deleting .cache, public
info Successfully deleted directories
success open and validate gatsby-configs - 0.036s
success load plugins - 0.947s
success onPreInit - 0.010s
success delete html and css files from previous builds - 0.010s
success initialize cache - 0.007s
success copy gatsby files - 0.054s
success onPreBootstrap - 0.009s
success createSchemaCustomization - 0.044s
success source and transform nodes - 0.182s
success building schema - 0.273s

 ERROR #11321  PLUGIN

"gatsby-plugin-offline" threw an error while running the createPages lifecycle:

Reducers may not dispatch actions.



  Error: Reducers may not dispatch actions.

  - redux.js:214 dispatch
    [vermehrung]/[redux]/lib/redux.js:214:13

  - index.js:67
    [vermehrung]/[gatsby]/dist/redux/index.js:67:88

  - index.js:14 Object.dispatch
    [vermehrung]/[redux-thunk]/lib/index.js:14:16

  - index.js:45 dispatch
    [vermehrung]/[gatsby-cli]/lib/reporter/redux/index.js:45:9

  - redux.js:483 Object.createLog
    [vermehrung]/[redux]/lib/redux.js:483:12

  - reporter.js:168 Reporter.warn
    [vermehrung]/[gatsby-cli]/lib/reporter/reporter.js:168:41

  - patch-console.js:22 Object.console.warn
    [vermehrung]/[gatsby-cli]/lib/reporter/patch-console.js:22:14

  - utils.js:449 Object.warn
    [vermehrung]/[xstate]/lib/utils.js:449:26

  - StateNode.js:1313
    [vermehrung]/[xstate]/lib/StateNode.js:1313:29

  - Array.map

  - StateNode.js:1311 StateNode.formatTransitions
    [vermehrung]/[xstate]/lib/StateNode.js:1311:18

  - StateNode.js:321 StateNode.get [as transitions]
    [vermehrung]/[xstate]/lib/StateNode.js:321:51

  - StateNode.js:296 StateNode.get [as on]
    [vermehrung]/[xstate]/lib/StateNode.js:296:36

  - StateNode.js:230
    [vermehrung]/[xstate]/lib/StateNode.js:230:93

  - Array.forEach

  - StateNode.js:230 StateNode._init
    [vermehrung]/[xstate]/lib/StateNode.js:230:45


failed createPages - 0.082s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@brysbra
Copy link

brysbra commented Jul 2, 2020

@barbalex, I'm experiencing the same thing. I'm not using gatsby-plugin-offline though.

15:40:44 success createPages - 0.001s
15:40:44
15:40:44 ERROR
15:40:44
15:40:44 UNHANDLED REJECTION Reducers may not dispatch actions.
15:40:44
15:40:44
15:40:44
15:40:44 Error: Reducers may not dispatch actions.
15:40:44
15:40:44 - redux.js:214 dispatch
15:40:44 [app]/[redux]/lib/redux.js:214:13
...
15:40:44 not finished createPagesStatefully - 0.158s

@annez
Copy link

annez commented Jul 2, 2020

The fix right now that works with the latest gatsby + you do not need to copy any other package version etc is:

In your package.json

"resolutions": {
  "babel-plugin-remove-graphql-queries": "2.9.9"
},

Either using yarn or choosing to install the npm resolution piece. This works both dev and build.

@barbalex
Copy link

barbalex commented Jul 2, 2020

@brysbra yes, if I uncomment gatsby-plugin-offline I still get the error too. It simply mentions something else.

@617dev
Copy link
Contributor

617dev commented Jul 2, 2020

FWIW, in debugging our builds we've found that any plugin (including our local ones) that use the createPages API with the latest gatsby-cli version, error with this same error. In other words, I don't think this is specific to any plugin.

Separately it looks like there was an issue for dev builds when core-js was upgraded to v3 but it looks like that was reverted in the latest gatsby releases greater than patch 15.

@barbalex you should try downgrading your gatsby-cli now that you've updated to the latest gatsby version that fixes the other core-js issue. It should fix your issue and allow you to build for now. just run yarn add [email protected]

@nugoo1
Copy link

nugoo1 commented Jul 2, 2020

Same issue here

@kondricz
Copy link

kondricz commented Jul 2, 2020

Why is this issue closed? :)

For me it seems to be an infinite amount of bugs, using the following versions seemingly fixes it:

"gatsby": "2.23.17",
"gatsby-cli": "2.12.54",

However, locally I can finish build with this combination. But once it is running on the CI I receive this:

/home/runner/work/collect-frontend/collect-frontend/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

RangeError: Maximum call stack size exceeded

any idea why?

EDIT: It is github actions on an ubuntu-latest container, running NPM.

@hiramoto
Copy link

hiramoto commented Jul 2, 2020

Same issue here.
image

In my case, the build succeeds but see this issue on GitLab.

@kondricz
Copy link

kondricz commented Jul 2, 2020

@hiramoto having these version fixed this:

"gatsby": "2.23.17",
"gatsby-cli": "2.12.54",

once You update, You will get the next one

@Szegerege12
Copy link

@kondricz same error here on:
"gatsby": "2.19.24", "gatsby-cli": "2.12.35",

@rootlinux2
Copy link

rootlinux2 commented Jul 2, 2020

Same Issue here, I just delete everything "cache", "node_modules", "public", "yarn.lock", make a fresh install, update my gatsby-cli to the latest version.
image

Just doing what @alexjsdev said in a comment before yarn add [email protected] this fix the issue for me. Thanks to @alexjsdev

@kondricz
Copy link

kondricz commented Jul 2, 2020

    "gatsby": "2.23.5",
    "gatsby-cli": "2.12.54",

I am using these versions and it is working perfectly. It does not give me error about maximum call stack.

@Ex4l
Copy link

Ex4l commented Jul 2, 2020

Same Issue here, I just delete everything "cache", "node_modules", "public", "yarn.lock", make a fresh install, update my gatsby-cli to the latest version.
image

Just doing what @alexjsdev said in a comment before yarn add [email protected] this fix the issue for me. Thanks to @alexjsdev

I had exactly the same issue. I did not have gastby-cli installed in my project.

I just installed it and it's building correctly in local and in circle-ci.

@mathieudutour
Copy link
Contributor

The issue is tracked here: #25478 and will be solved by #25483

@hiramoto
Copy link

hiramoto commented Jul 3, 2020

@kondricz It worked. Thank you for your advice!

@617dev
Copy link
Contributor

617dev commented Jul 3, 2020

FYI it's fixed: #25478 (comment)

I just released [email protected] that should fix the issue

@darangi
Copy link

darangi commented Jul 7, 2020

For some weird reasons, I kept getting that error when using npm but on switching to yarn, it disappeared. Good to hear it is fixed 🎉

@sadiqful
Copy link

@Grsmto also had the same issue and adding "http://" to `siteUrl' fixed it. Feels like a Gatsby bug.

This worked for me too. Thank you

@aaronadamsCA
Copy link
Contributor

FYI to anyone who can't upgrade: npm install --save-exact [email protected]

#25478 (comment)

I opened #25483 to adjust xstate code, but we can't fix older releases, those will need to rely on yarn resolutions or npm install --save-exact tricks to not install [email protected] and keep it on lower version (4.10.0 for example)

@Danamorah
Copy link

I had the same issue and did a reinstall of the dependencies and was fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests