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: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. #25093

Closed
SurajVerma opened this issue Jun 18, 2020 · 8 comments · Fixed by #25107 or #25122
Assignees
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@SurajVerma
Copy link

SurajVerma commented Jun 18, 2020

Description

I am trying to setup a Gatsby site using Gatsby blog theme starter, everything works as expected, till the time I run gatsby develop

Steps to reproduce

Run below commands, which i picked from Gatsby official documentation

gatsby new my-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme
cd my-blog
gatsby develop

here is the link to my git repo : my-blog

Expected result

As per the documentation, I am supposed to get below page:

starter-blog-theme-default

Actual result

But I am getting this:

image

Environment

  System:
    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz
    Shell: 5.0.16 - /bin/bash
  Binaries:
    Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node
    npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm
  Browsers:
    Chrome: 83.0.4103.106
    Firefox: 77.0.1
  npmPackages:
    gatsby: ^2.23.3 => 2.23.3 
    gatsby-theme-blog: ^1.6.42 => 1.6.42 
  npmGlobalPackages:
    gatsby-cli: 2.12.46
@SurajVerma SurajVerma added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 18, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 18, 2020
@jbuget
Copy link
Contributor

jbuget commented Jun 18, 2020

I had the same this morning. The problem was that I did not have yarn installed (only NPM).

I think the problem is due to a problem with the two dependencies theme-ui and a second one that I can not remember the name.

@ascorbic ascorbic added status: inkteam assigned and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 18, 2020
@laurieontech laurieontech self-assigned this Jun 18, 2020
@laurieontech
Copy link
Contributor

Thanks for opening this issue! At the moment, I'm unable to reproduce the error you're seeing. You noted a link to your specific repo, but I don't believe it's linked. Would you be able to add that?

@SurajVerma
Copy link
Author

@jbuget : I too didn't have yarn installed.
@laurieontech: Sorry, updated now.

@laurieontech
Copy link
Contributor

Wonderful, was able to reproduce. npm and yarn should both work, so I'll dig into this.

@laurieontech laurieontech added the status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. label Jun 18, 2020
@laurieontech
Copy link
Contributor

laurieontech commented Jun 18, 2020

To add context, the underlying bug is that there are two different theme-ui versions in the current gatsby monorepo. For some odd reason, npm resolves to the bad one and yarn resolves to the good one.

This should be resolved in the latest Gatsby release but the starter is picking up the version before that. Will get a new release published shortly.

@laurieontech
Copy link
Contributor

Unfortunately the fix did not solve the problem. So continuing to work on this unmet peer dependency issue (only in npm).

@laurieontech laurieontech reopened this Jun 18, 2020
@SurajVerma
Copy link
Author

As @jbuget pointed out, I tried yarn and it is working if I am doing following:

gatsby new my-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme
cd my-blog
yarn
gatsby develop

@laurieontech
Copy link
Contributor

Understood. This is definitely only an issue with npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
5 participants