-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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-source-contentful] Error at fresh installment #3064
Comments
This sounds like a genuine bug — would you like to put together a PR for this? |
I can try to find out, whats the problem, but I'm not sure if I know enough about this specific plugin or gatsby's way of handling data. So, can't promise anything 🤷♂️ |
Ok :-) Start by adding console.logs around where the error is happening in the plugin — that's what I do to understand what type of data is triggering the error and how to handle it. |
I am encountering this issue as well. It seems to be tied to references. As cpannwitz described, the issue resolves itself when removing the references from the content altogether. It does not need to be removed from the content model. Note, in my case the reference was a "One Reference," and like cpannwitz, the reference was populated. Something curious, in my case, the reference did not give me issues at first. It wasn't until I attempted to implement onCreateNode. The issue then persists until I clear the reference in Contentful. Doesn't make much sense as to why this would occur, perhaps I'm just overthinking it 😄 EDIT: This may very well be an issue with Contentful or my frequency in changing my Content models. Noticing data being published under old structures. I will try again tomorrow and give an update. Attaching my log. |
I experienced the same, @Garbonauta . I tend to think, it has something to do with the "subscription" to data of the source-plugin to contentful. (as far as I know, you can simply query data from contentful, but also "subscribe" to it - api-wise) |
@cpannwitz I fully agree. I was able to circumvent the issue for about a day. I had to redo the Content models and content to get it to work. Luckily, I am at testing so this is no big deal. However, once I had the need to edit the content. The issue appeared again. Like you I noticed the following:
At this point, I would like to know what do we do from here? What is the next step and I'll take it. |
Same issue - references were the cause of the problem for me as well. |
I think I may be on the right track as to what is happening. It appears the plugin, gatsby-source-contentful, is, for the most part, pulling the right information from contentful. I still have some suspicions as to whether this statement is correct as I still had more issues described below. I think what is happening, is that for example: Now, I do not think this is the entire issue, I was still encountering problems where the recreated redux store did not include the missing reference types. Causing my code to crash at runtime. However, the issue appears to have fixed itself, not sure how, as I was doing some risky and ultimately useless manipulation of the redux-state.json file. I say useless, because it was in one instance where I deleted the store and it was correctly recreated. For now, everything is working for me. I do expect the issue to reappear as I am still changing content models and the content itself in contentful. I will continue to take a look and see what I can find. |
I also have this issue but it occurs at build time. Like other issues in this thread, it occurs when using contentful references and
|
Just wondering if there had been any updates on this issue. I'm seeing the same thing as soon as I added references into my contentful data. It seems to be happening on build or develop. I tried using the previous method of deleting the redux-state.json in cache then rerunning but it doesn't seem to make a difference. |
I'm now seeing this also with Contentful on Gatsby V2 and |
Not sure if this helps but this happens to me when I have the following schema: BUTTON PAGE if Button has a page reference (any page, even ones that don't have it as a component) it will throw. |
Thanks @pr1ntr indeed we found out that creating a new page model that wasn't called |
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! |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
I'm also running into this. Adding a one to many content link does it. |
Same |
I'm also running into this issue! I'm using a one-to-one reference, and as @cpannwitz mentions, as soon as I add a reference, it breaks - removing it removes the error. Cleaning out the cache doesn't appear to really have an effect. |
Running into issues. definitely arising from the references |
Hey, I has some issues and managed to fix them. I will update on this thread when I get home, no aceeas to code base atm..! Basically u have to import something to gatsby.config and if you're using any env variables, ads a GATSBY_ prefix to your environment variables |
Add this to the top of gatsby-config.js
And this is how my gatsby-node.js looks:
|
Can you check if |
Hi, I was having this issue and it was a circular reference, I disabled one side of the circular reference and it went away. You dont necesarrily have to remove it but you can just disable it in the response. |
@wardpeet Thanks for that comment, that has fixed my issue. I did a bit of debugging but the source code for this plugin is quite complex to get into so I didn't get too far, enough to understand that there is some sort of issue going on with working out referencing. We're now seeing errors about mismatched typings, everything builds fine in netlify but wondering if there is any advice on whether or not we should be actively trying to fix this:
The error message makes sense as we reference the service type as a multiple reference in the homepage content type and then as a single reference in another content type we use with a templated page... need to do some more digging with this one EDIT: |
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! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
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 As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing! Thanks again for being part of the Gatsby community! |
I'm having this problem on a fresh install of gatsby, I chose to add
|
Hey. I'm currently trying to setup a basic gatsby site with the contentful-source-plugin.
Last week everything went pretty great, until that moment I had to show off my results and - bam - the whole thing went down in 5 minutes. I had no success in recreating and debugging.
Specifically gatsby-source-contentful errors out with the following:
entryItemFields[foreignReference.name].push is not a function
Preconditions:
node -v:
8.9.1
gatsby-cli -v:
1.1.24
gatsby-cource-contentful version: tried everyone from
1.3.20
to1.3.28
Steps to reproduce:
Thanks for any help!
The text was updated successfully, but these errors were encountered: