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

this.props.data is undefined during hot reload #5048

Closed
orf opened this issue Apr 19, 2018 · 8 comments
Closed

this.props.data is undefined during hot reload #5048

orf opened this issue Apr 19, 2018 · 8 comments
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@orf
Copy link

orf commented Apr 19, 2018

Description

When running gatsby develop and making a change to a markdown file the page fails to render again until gatsby is restarted, failing with this.props.data is undefined

Steps to reproduce

  1. Clone https://github.com/orf/blog-gatsby/

  2. Run yarn && yarn dev

  3. Open a blog page

  4. Make a change to any markdown file within src/pages/

  5. See that the page now fails to load with a React error, and refreshing does not work

Expected result

The page should load

Actual result

The page does not load

Environment

  • Gatsby version (npm list gatsby): 1.9.253
  • gatsby-cli version (gatsby --version): 1.9.250
  • Node.js version: 8
  • Operating System: MacOS
@DxCx
Copy link
Contributor

DxCx commented Apr 19, 2018

i am having the same issue running linux and node 9.
gatsby version 1.9.201 (both cli and gatsby)

@LekoArts
Copy link
Contributor

Try putting everything but index.js (from src/pages) into another folder and also modify gatsby-config respectively. The pages folder is not intended for markdown files afaik.

@DxCx
Copy link
Contributor

DxCx commented Apr 19, 2018

for my case i dont have markdown inside pages..
and it used to work properly, today i've git clean -xdf + npm install and then it started to happen..
i'll probably tomorrow try to downgrade and see which version worked

@m-allanson
Copy link
Contributor

m-allanson commented Apr 20, 2018

@orf thanks for the link to the repo, I can confirm the error you're seeing. Changing a markdown file triggers multiple recompiles in Gatsby followed by a MaxListenersExceededWarning, which doesn't seem right.

info changed file at /projects/blog-gatsby/src/posts/how-not-to-make-an-april-fools-joke/index.md
info changed file at /projects/blog-gatsby/src/posts/how-not-to-make-an-april-fools-joke/index.md
 WAIT  Compiling...                                                                                              10:59:29

 DONE  Compiled successfully in 714ms                                                                            10:59:30

 WAIT  Compiling...                                                                                              10:59:31

 DONE  Compiled successfully in 392ms                                                                            10:59:31

(node:60438) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit

I"m not sure what's causing this but going to label it as a bug for now.

@m-allanson m-allanson added type: bug An issue or pull request relating to a bug in Gatsby help wanted Issue with a clear description that the community can help with. labels Apr 20, 2018
@DxCx
Copy link
Contributor

DxCx commented Apr 20, 2018

I can see the same behavior without this warning (if that helps nail it down)
Also, if there any leads you can provide for debuging this (like where it should be inject from when hot reloading vs initial develop) i will be able to provide more helpful info

@orf
Copy link
Author

orf commented Apr 20, 2018

The warning has been there previously, when I ran into another issue: #3551

I don't think it's related to this at all.

@gatsbot
Copy link

gatsbot bot commented Nov 19, 2018

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

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

gatsbot bot commented Nov 30, 2018

This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue.

@gatsbot gatsbot bot closed this as completed Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

4 participants