Git Product home page Git Product logo

Comments (13)

johncherba avatar johncherba commented on June 26, 2024 1

@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!!

from gridsome-source-kentico-kontent.

markcoole avatar markcoole commented on June 26, 2024

Hey @johncherba,

Not sure if i'll be able to help. Do you have any custom elements, nested content types or additional languages?

from gridsome-source-kentico-kontent.

johncherba avatar johncherba commented on June 26, 2024

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!

from gridsome-source-kentico-kontent.

johncherba avatar johncherba commented on June 26, 2024

@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?)

from gridsome-source-kentico-kontent.

markcoole avatar markcoole commented on June 26, 2024

@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.

from gridsome-source-kentico-kontent.

johncherba avatar johncherba commented on June 26, 2024

@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.

from gridsome-source-kentico-kontent.

markcoole avatar markcoole commented on June 26, 2024

@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!

from gridsome-source-kentico-kontent.

johncherba avatar johncherba commented on June 26, 2024

@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'...

from gridsome-source-kentico-kontent.

markcoole avatar markcoole commented on June 26, 2024

@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?

from gridsome-source-kentico-kontent.

johncherba avatar johncherba commented on June 26, 2024

@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?

from gridsome-source-kentico-kontent.

markcoole avatar markcoole commented on June 26, 2024

@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.

from gridsome-source-kentico-kontent.

johncherba avatar johncherba commented on June 26, 2024

@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.

from gridsome-source-kentico-kontent.

CMeeg avatar CMeeg commented on June 26, 2024

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):

  • Open up your Gridsome project that is having the issue in VS Code
  • Click the "Run & Debug" view
  • Click the "create a launch.json file" link in the sidebar and select any environment (it doesn't matter because we will replace the generated output)
  • Add the config from this GitHub issue to your launch.json file, replacing the generated output
  • In the "Explorer" view open node_modules/@meeg/gridsome-source-kentico-kontent/src/KenticoKontentSource.js
  • Attach a breakpoint at the start of the load function (or anywhere you fancy really!)
  • Back in the "Run & Debug" view click "Start Debugging"
  • Your breakpoint should get hit - occasionally the debugger attaches, but the Gridsome process doesn't start so I just stop and start debugging when that happens

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)!

from gridsome-source-kentico-kontent.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.