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

TypeError: Cannot read property 'componentChunkName' of undefined #12725

Closed
AAverin opened this issue Mar 21, 2019 · 12 comments
Closed

TypeError: Cannot read property 'componentChunkName' of undefined #12725

AAverin opened this issue Mar 21, 2019 · 12 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@AAverin
Copy link

AAverin commented Mar 21, 2019

Description

After implementing some generated pages (blog posts) often dev version of Gatsby breaks with TypeError: Cannot read property 'componentChunkName' of undefined

Screen Shot 2019-03-21 at 14 45 10

Only restarting gatsby develop solves the problem

Steps to reproduce

Not sure what was the cause and how to cleanly reproduce it. I assume that generating pages using createPages, onCreateNode and onCreatePages might be the cause of the problem.

Environment

System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.10.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 73.0.3683.86
Safari: 11.1.2
npmGlobalPackages:
gatsby-cli: 2.4.4

@AAverin
Copy link
Author

AAverin commented Mar 21, 2019

After starting gatsby develop everything works for a while, but then randomly breaks and page no longer opens

@dbrookes
Copy link
Contributor

I have the same issue on hot reload, any chance you're using gatsby-plugin-remove-trailing-slashes?

Removing gatsby-plugin-remove-trailing-slashes from gataby-config.js brings back hot reloading in dev for me

@AAverin
Copy link
Author

AAverin commented Mar 21, 2019

I have this, maybe some of the plugins use remove-trailing-slashes internally?

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
  },
  plugins: [
    {
      resolve: `gatsby-plugin-google-analytics`,
      options: {
        // Setting this parameter is optional
        anonymize: true,
      },
    },
    {
      resolve: `gatsby-plugin-react-helmet`
    },
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 970,
            },
          },
          {
            resolve: "markdown-embed-youtube"
          }
        ],
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/src/pages/blog/posts`,
        name: "pages",
      },
    },
    {
      resolve: `gatsby-plugin-facebook-pixel`,
      options: {

      },
    },
    `gatsby-remark-copy-linked-files`,
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-remark-images`,
      options: {
        maxWidth: 1080,
      },
    }
  ],
}

@sarahannnicholson
Copy link
Contributor

I am seeing this as well, I haven't tried installing remove-trailing-slashes yet.

But I have a question for everyone. When you do gatsby build then gatsby serve and go to http://localhost:9000 do you get the same error? Just wondering if what I am seeing with gatsby serve is related to this

@AAverin
Copy link
Author

AAverin commented Mar 21, 2019

I am still struggling to build, get some error inside error message prettifier similar to #6668
Will post a message when I build the project
Also, maybe look to #4360. Once I applied a fix from there I think I stopped getting the componentChunkName message

@khades
Copy link

khades commented Mar 22, 2019

that issue was fixed in recent 2.2.4 gatsby build, try to update gatsby itself, not cli

@sidharthachatterjee
Copy link
Contributor

@sarahannnicholson This shouldn't occur when running gatsby build then gatsby serve since the error looks like it's coming from the Dev 404 code, which isn't included in the production build

@AAverin Can you link to a minimal reproduction of this if possible?

@sidharthachatterjee sidharthachatterjee added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Mar 22, 2019
@khades
Copy link

khades commented Mar 22, 2019

#12671 this pull fixes pages deletion (even 404) in development mode, its live in version 2.2.4

@sidharthachatterjee
Copy link
Contributor

Thank you @khades

@AAverin Can you confirm if updating to 2.2.4 fixes your issue?

@AAverin
Copy link
Author

AAverin commented Mar 22, 2019

I'll update and keep testing, thanks

@gatsbot
Copy link

gatsbot bot commented Apr 12, 2019

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’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. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Apr 12, 2019
@gatsbot
Copy link

gatsbot bot commented Apr 23, 2019

Hey again!

It’s been 30 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 reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

No branches or pull requests

5 participants