Closed johncherba closed 4 years ago
Hey @johncherba,
Not sure if i'll be able to help. Do you have any custom elements, nested content types or additional languages?
Hey @markcoole
Thanks for the reply. We do not have custom elements or additional languages. I did talk to the person who said we had nested content types but I am not sure how to identify them by looking at the schema I posted above. Could this be the issue of having to many nested content types or require a cleaner way to organize data? This is a port from a previous solution that we are building.
Thanks for your help!
@markcoole I also was looking at debug
. Would that be an option in this case to see specifically where it's breaking? If so, would this be easy to set up for the project? (maybe an example of how to configure?)
@johncherba I've not used the debug npm package before so I can't advise.
You can clone the plugin and point your local build to it. Then log where the schema is built and see what is output and at what point it breaks. That might yield some idea on where it's failing.
I've tried creating some heavily nested content types but they appear to work fine.
Is this a new project or existing? Is there currently any front end code to it?
Just wondering if it's an existing code project can you create a new gridsome project, install the plugin, point it to your existing Kentico Kontent project and build the schema?
Is there a way you can set up something similar with nested types? Trying to think of a good way to help but I need to replicate it first.
@markcoole I did get debug to work, it's easy to do to see what the plugin is doing without cloning the plugin. Thanks for pointing that out though and it will be useful if I can actually break on the function. If your interested you can see debug info by putting this in terminal:
DEBUG=gridsome-source-kentico-kontent:* gridsome develop
or similar...might need to install debug
npm.
It gives really good output so I'm looking for clues. I might have narrowed it down to the Content Type that is throwing the error.
I started a new project and tried it. I also forked another project and tried it. I have other gridsome projects and PoC that are working fine and pointing to less complicated Kontent projects. I will see if I can share or replicate existing Kontent that does break it.
Thanks for your help and I hope you are having a good monday.
@johncherba Yeah. It suggests something is missing when the node is being made. I tried the debug mode that you suggested. Pretty good to see the output. I've tried to break it my end as much as I can but no success. I wondered if it had something to do with file types. There's an enum in the asset resolver which doesn't include pdfs. I saw you have an asset element which is pdf. Nested content types with file types it's not sure what to do with? Not sure. If you do find the cause please let me know!
@markcoole Thanks for the file type suggestion. I did try a pdf file type upload, created an asset Content Type and then added it to another containing Content Type in another project and it worked. :/
Still hunting it down, I'm going to look at your 'something is missing when the node is being made'...
@johncherba is this a new issue? Do you have more than 2000 content items?
From the 1st of February the /items endpoint is limited to 2000 (incl. linked items) as described in Kontent API changes.
Can you try going to https://deliver.kontent.ai/{projectID}/items and see if the object that returns is complete and whole?
@markcoole wow, okay. Thanks again. Here's what I found in Headers:
x-request-charge: 432
and when I search the deliver url and search for modular_content
I get 1/1,939 hits... hmmm.
It appears complete and whole (i'm going to check with another dev), could this be the issue?
@johncherba I'm not sure. I remember at one point they said it would be limited to 1000 but docs now say 2000. 432 seems fine though.
You could try lowering the depth and see if that helps. It would at least rule it out maybe. I think you set it in the config.
plugins: [ { use: '@meeg/gridsome-source-kentico-kontent', options: { deliveryClientConfig: { projectId: process.env.KENTICO_KONTENT_PROJECT_ID, contentItemsDepth: 1 } } }, ]
By default it is set to 3 so try 1 or 0 maybe? I'm clutching at straws but it's all trial and error.
@markcoole okay found what the issue was! We were using Kontent from a couple iterations back. We had an 'Image' Content Type so we could add alt
, etc. to an Asset. The 'Image' Content Type was then used in another Content Type and declared as an Asset when it should be a Linked Item. It really should be just an Asset and not an embedded 'Image' Content Type is the best approach and not use a custom 'Image' Content Type because this has been resolved. Sorry if this is confusing. Let me know if I can explain better.
Thanks for all your help. Let me know if I can return the favor in any way.
Hi @johncherba, sorry to hear you've been having issues and I'm glad it sounds like you have sorted them out. Thanks @markcoole for helping out - I appreciate it.
It may be a moot point now you've sorted this out, but if it's helpful for future this is how I've been debugging (when the log output from the debug
module is not enough):
launch.json
file, replacing the generated outputnode_modules/@meeg/gridsome-source-kentico-kontent/src/KenticoKontentSource.js
load
function (or anywhere you fancy really!)If there is an issue that you need to work around you can also at that point fork the plugin repo, use yarn link
, change the source code, test using your project and submit a PR (if you want to!).
I will add the above to the readme as it occurs to me that would be useful to have that documented.
I have been inactive on this project for a little while, but hoping to get some time to get back on top of things soon and catch up with all things Gridsome and Kontent. If you have any further feedback or suggestions for this plugin I'd be glad to hear from you (and you @markcoole - I will review your PR this week)!
@CMeeg No issues! lol. Just doing my job. Thanks for the debug info. I did use your debug documentation that currently exists in the readme and it did help me track down the offending Kontent data, so thank you. Appreciate you letting me and @markcoole collaborate on this repo even though it was an issue with the data in Kontent and not with your awesome plugin. Thanks for all your work on this and I will try the debug solution you provided when needed.
Again, thanks @markcoole and @CMeeg for helping out! Really appreciate the dev community sometimes!!
Hello,
I am getting the following error when using the plugin:
In
gridsome.config.js
there is:and the schema it's trying to pull is, it should do it automagically but here is the schema.graphql file:
On newly created projects gridsome has worked great. I think it may be an issue with this plugin trying to parse data that has not had logic written for it in the plugin, I've tried to debug but need to learn more on how to get verbose output if that's possible from plugin.
Thanks! Any help appreciated.