Hi, trying to integrate react-grid-layout library with JsonForms editor. I got this error. Module parse failed: Unexpected token (203:74)
File was processed with these loaders:
…/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
I have @babel/plugin-proposal-optional chaining installed and made this change in the rollup config:
import babel from ‘rollup-plugin-babel’;
plugins: [typescript(), css(),babel({
presets: [
‘@babel/preset-env’
],
plugins: [‘@babel/plugin-proposal-optional-chaining’,‘@babel/plugin-transform-optional-chaining’]
}), json(), visualizer({ open: false })],
Still optional chasing is not transpiled. Any advice? Thanks.
Yes, about JSON Forms editor, the one in the link. Practically, tried everything. Added @babel/plugin-proposal-nullish-coalescing-operator too. I’m modifying rollup.config? What I’m doing wrong?
Could you explain what do you mean? What kind of bundling problem? Problem is that babel loader doesn’t use these plugins when transpiling dependency libraries. So the question is what do I need to do to fix it. Also how big of an effort do you think is to update the visual editor to use webpack 5 and babel 8? Thanks!
I see all needed plugins on @babel directory. But they are not used.
My package.json looks like this
In general you should try to not introduce any dependencies in the root package.json.
There is nothing preventing you from using the latest webpack and babel. As you can see from our rollup configuration, we don’t do anything special in the jsonforms-editor, so the effort solely depends on the familiarity of the developer with tools like webpack.
I was able to integrate the library finally. It was a dependency problem. Thanks for pointing it out!
Now I have another problem. Looks like JsonForms removes property “key” from the “div” in the renderer. Practically ‘<div key="123"></div>' becomes '<div></div>’. But layout needs “key” identifier. Do you know why it’s being removed? Thanks!