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

gatsby serve - Hint: "Did you mean this? serve" - confused🥴 #16092

Closed
vdespa opened this issue Jul 25, 2019 · 6 comments · Fixed by #16246
Closed

gatsby serve - Hint: "Did you mean this? serve" - confused🥴 #16092

vdespa opened this issue Jul 25, 2019 · 6 comments · Fixed by #16246
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@vdespa
Copy link

vdespa commented Jul 25, 2019

Summary

I am cloning the repo, running npm install and copying the public folder from a previous pipeline step.

If run gatsby serve, it returns an exit code 1.

If I run gatsby build again, it works.

Relevant information

I am running gatsby serve in my CI/CD pipeline. The "error" that is coming back is very confusing.

Screenshot 2019-07-25 at 22 13 40

Any ideas what the problem is?

Environment (if relevant)

gatsby info --clipboard

System:
OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (1) x64 Intel(R) Xeon(R) CPU @ 2.30GHz
Shell: 4.4.12 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Languages:
Python: 2.7.13 - /usr/bin/python
npmPackages:
gatsby: ^2.13.31 => 2.13.31
gatsby-image: ^2.2.6 => 2.2.6
gatsby-plugin-manifest: ^2.2.3 => 2.2.3
gatsby-plugin-offline: ^2.2.4 => 2.2.4
gatsby-plugin-react-helmet: ^3.1.2 => 3.1.2
gatsby-plugin-sharp: ^2.2.8 => 2.2.8
gatsby-source-filesystem: ^2.1.5 => 2.1.5
gatsby-transformer-sharp: ^2.2.4 => 2.2.4
npmGlobalPackages:
gatsby-cli: 2.7.20

@m-allanson
Copy link
Contributor

This looks very strange. It seems like the gatsby serve --verbose command is being run multiple times for some reason.

Are you able to replicate this error when running locally? And are you able to share the project that causes this error?

@m-allanson m-allanson added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Jul 29, 2019
@vdespa
Copy link
Author

vdespa commented Jul 31, 2019

issue-16092.zip

Thank you for your reply @m-allanson . I have managed to replicate this locally as well.

It seems that gatsby serve gets confused if the .cache folder is missing.

@m-allanson
Copy link
Contributor

Thanks for the investigation @vdespa! I've opened a PR #16246 that should fix this.

As a workaround you can copy .cache/match-paths.json from the previous pipeline step, and the serve command should run as expected.

@sidharthachatterjee
Copy link
Contributor

I just stopped by to say that 🥴 is a great emoji and we can imagine your sentiment 😂

@vdespa
Copy link
Author

vdespa commented Aug 5, 2019

Great, thanks for the quick fix @m-allanson

@molebox
Copy link

molebox commented Nov 7, 2020

This still happens....

ianand added a commit to moovweb-docs/xdn-docs that referenced this issue Nov 9, 2020
@molebox pointed out we should instruct users to use `gatsby develop` instead of `gatsby serve` to avoid issues the first time through the guide

https://forum.moovweb.com/t/skip-global-xdn-npm-install/140/3

gatsbyjs/gatsby#16092
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants