Jsonforms and node 16?

Wondering if this is ready to work with vue2, vue-cli-service with webpack 5, and node16 yet? I tried updating today and got some errors around json-schema-ref-parser resolvers for http and https with webpack 5. I configured fallbacks for those, but when launching a form I now get this console error:

‘jsonforms’ or ‘dispatch’ couldn’t be injected. Are you within JSON Forms? in data()

Hi @naomi, for out-of-the-box Webpack 5 support you need to upgrade to JSON Forms 3.0 Alpha. You can do this via the next stream, e.g. npm install --save @jsonforms/core@next. Doing this I was able to use the latest vitejs, see #1744, which also uses Webpack 5.

Hm @sdirix unfortunately I’m still getting that error. Was the #1744 example using vue2?

Before the error, I get 2 of these warnings:
[Vue warn]: inject() can only be used inside setup() or functional components.

And those warnings trace to here in @jsonforms/vue2:

var useJsonFormsRenderer = function useJsonFormsRenderer(props) {
var jsonforms = compositionApi.inject(‘jsonforms’);
var dispatch = compositionApi.inject(‘dispatch’);

if (!jsonforms || !dispatch) {
throw “‘jsonforms’ or ‘dispatch’ couldn’t be injected. Are you within JSON Forms?”;
}

Hi @naomi, I can reproduce the problems with @vue/cli@next. I’m currently uncertain whether the problem lies in the @next vue tooling, the JSON Forms build or just a mismatch of configurations. The rework of the JSON Forms build is high on our priority list, so maybe the issue then resolves itself. I’ll test with @vue/cli@next when working on the issue.

Okay sounds good, thank you @sdirix. When I installed the 3.0 alpha version I didn’t use @next, so hopefully that helps narrow things down

hey @sdirix just wondering if there was an ETA for the rework of the build?

Hi @naomi, this is still very high on the priority list and will be tackled before the 3.0 release. The ETA depends on our workload.

As our new Vuetify renderers work with Vue 2 I would advise checking again whether you can get it to work on your side. This is very likely a Vue versioning issue, for example your composition api package might be of a newer version than the one JSON Forms is build against.

You might want to check out our professional support offers which include the possibility to prioritize tasks which are important to you, e.g. the build system.

@sdirix awesome I’m excited to try the new vuetify renderers. I think that may solve the issue because the error I was getting is coming from the custom renderer flow.

quick question…is that package already published? I get this error when trying to npm install after adding it to my package.json: '@jsonforms/vue2-vuetify@3.0.0-alpha.1' is not in the npm registry

Hi @naomi, they are not yet published but will be very soon.

1 Like