Hello, thanks for your hard work.
Unfortunately I’m having trouble migrating to jsonforms 3.0.0.
My project is on nuxtjs (2). Here are my dependencies:
"@jsonforms/core": "3.0.0",
"@jsonforms/vue": "3.0.0",
"@jsonforms/vue2": "3.0.0",
"@jsonforms/vue2-vanilla": "3.0.0",
"nuxt": "2.16.0",
"vue": "2.7.0",
"vue-template-compiler": "2.7.0",
call jsonforms
<template>
<div data-vue-component-name="FormBuilder">
<JsonForms1
ref="json-forms"
:key="renderId"
:data="value"
:renderers="renderers"
:schema="schema"
:uischema="uiSchema"
:ajv="ajv"
:readonly="readonly"
@change="$emit('change', $event)"
/>
</div>
</template>
I am getting the following errors
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
'jsonforms' or 'dispatch' couldn't be injected. Are you within JSON Forms?
I also had to enter the following in the nuxt config
build: {
extend(config) {
config.module.rules.push({
test: /\.js$/,
exclude: {
and: [
/node_modules/,
],
not: [
/@jsonforms/,
],
},
use: {
loader: 'babel-loader',
},
});
config.module.rules.push({
test: /\.ajv$/,
use: {
loader: 'babel-loader',
},
});
},
},
After that my project started to run but displays the above errors.
I also removed all my custom renderers from the array to exclude them from possible problems, but the error remained, only after I hid json-forms via v-if=“false” the error disappeared (oddly enough )
I previously had jsonforms version 2.5.* which worked fine, I decided to upgrade to the new version to get the “i18n” prop to replace “is a required property” under my inputs, if there is a way to do this without going to third version please let me know.