How to debug issues with Volto views not being rendered?

Hello, I'm trying to debug an issue I'm seeing with specifying a custom component to be a view for a certain content type inside of my src/config.js.

I believe that the syntax described on training.plone.org which says to export default function applyConfig(config) { ... } is a little outdated?

I think that we're supposed to simply export settings, views, widgets, etc objects from our src/config.js, right?

Unfortunately, no matter what names I use, I cannot get volto to render my custom component instead of the default view for any given content type:

export const views = {
  ...defaultViews,
  contentTypesViews: {
    ...defaultViews.contentTypesViews,
    thing: ThingView,

I think I've ruled out issues with the content type by creating it from the volto ui at http://localhost:3000/controlpanel/dexterity-types and making a single simple instance with just a title and description at the root of my site.

So it must be some kind of naming issue. But what I'm struggling with is how to debug the view selection process. I've tried running DEBUG=volto:* yarn start but I don't see any additional information being logged. And I just don't see any other way to get insight into how Volto is selecting the view to use...

Thanks for reading and for any thoughts! I'm sure it's a simple issue in the end, I'm just a bit stuck without a way to debug :confused:

No, the training is correct. The Volto config system has been updated and the direct export from src/config.js is not supported anymore (or at least is tricky to support, AFAIK). This is the latest generator: volto/config.js at master · plone/volto · GitHub

To debug, I recommend ruling out any configuration issues: add a console.log(config) inside your applyConfig() function. You'll see the output logged in the browser console and you can inspect that JS object. Make sure you match the type, including the case. I think easiest is to look at the URL used for the add form, for example https://volto.kitconcept.com/add?type=Document.

1 Like

Thank you for this! That was my issue in the end, and I see that you created issues in github to update the docs! If I get time I'll try to open a quick PR for the ones that I got stuck on

Plone Foundation Code of Conduct