createDefault not working with Objects (vue-vanilla)

Hello, I’ve encountered a peculiar issue. In Production, I’m unable to add new entries to my array if the entry is an object, although they rendered and worked correctly in the development environment. I recall updating just the vue-vanilla package to access the off-the-shelf ObjectRenders. Later, after encountering this issue, I manually updated the other dependencies (@jsonforms/core and @jsonforms/vue) to match the same version. Could this manual update process have caused any additional errors?

How can I ensure that I have access to all renderers (similar to in development) in the production environment?

Although npm outdated does not show any errors and the package.json remains unmodified against development. Is there a known solution to this issue?

The method that calls createDefaultValue():

addButtonClick() {
  console.log(this.control.schema);

  this.addItem(
    this.control.path,
    createDefaultValue(this.control.schema)
  )();
},

And here’s the error I’m encountering:

TypeError: Cannot read properties of undefined (reading 'default')
    at pn (jsonforms-core.esm.js:1605:34)
    at fn (jsonforms-core.esm.js:1588:16)
    at Proxy.addButtonClick (CustomArrayListRenderer.vue:111:9)

package.json

"@jsonforms/core": "^3.2.1",
"@jsonforms/vue": "^3.2.1",
"@jsonforms/vue-vanilla": "^3.2.1",

annonation: After updating jsonforms/core and jsonforms/vue to version 3.2.1 aswell (i did that in believe to fix the production issue) i am encountering the same issue in development enviorment. (cannot add array entry if entry is an object)

this is what is being logged as control.schema:

{
    "type": "object",
    "properties": {
        "reference": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "identifier": {
            "$ref": "#/$defs/Identifier"
        },
        "display": {
            "type": "string"
        }
    }
}

Hi @nikohart,

First things first: You need to make sure that all your JSON Forms dependencies are on the same version number. We specify them accordingly via their peerDependency entries, however if you’re using an older version of npm you might only get warnings if they don’t fit. My guess is that you were consuming different versions of JSON Forms depending on whether it was a production or development build.

The issue is likely coming from here. My guess is that the schema can’t be resolved and then we’re not checking whether it was actually resolved.

Note that it should always be resolvable here, so there is either a mismatch in your schema / uischema, an issue with the CustomArrayListRenderer or it’s a bug in JSON Forms.

Can you post the full schema and UI Schema you are using as well as the custom renderer code? You could also double check whether the issue only occurs with the CustomArrayListRenderer or whether the issue also is reproducible with our off-the-shelf renderer sets.