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 complains about missing "sourceID" when saving content without previewing #6

Closed
ken-gladeye opened this issue Feb 4, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@ken-gladeye
Copy link

Description

I have Live Preview setup with a local Gatsby development as per instruction here

When editing an entry and hit Cmd+S, my local Gatsby displays the following error

"gatsby-source-craft" threw an error while running the sourceNodes lifecycle:

Value of the ID field "sourceId" can't be nullish. Got object with keys:
remoteTypeName, remoteId

Digging a bit deeper, it seems to me that the alertGatsby function in Plugin.php does trigger on save but does not send the required element id. Making the following edit seems to resolve the error to me.

Screen Shot 2021-02-04 at 13 55 45

Happy to do a pull request if you think it's the root cause of the issue.

Steps to reproduce

  1. Install and setup Gatsby Live Preview
  2. Edit an entry then hit Cmd+S

Additional info

  • Craft version: Craft Pro 3.6.2
  • PHP version: 7.3.26
  • Database driver & version: MySQL 5.7.28
  • Plugins & versions: 1.0.0-beta.2
@ken-gladeye ken-gladeye added the bug Something isn't working label Feb 4, 2021
@andris-sevcenko
Copy link
Contributor

Is this during live preview or just editing and saving?

@ken-gladeye
Copy link
Author

Just when editing and saving the entry not during live preview

@andris-sevcenko
Copy link
Contributor

@ken-gladeye go it, going to look into this!

andris-sevcenko added a commit that referenced this issue Feb 8, 2021
@andris-sevcenko
Copy link
Contributor

Alright, pushed a fix to the develop branch for this.

Have to implement #7 and should be good for another release. I plan to do that this week!

@ken-gladeye
Copy link
Author

awesome thanks @andris-sevcenko!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants