react-json-editor-ajrm
react-json-editor-ajrm copied to clipboard
ES6 syntax in polyfilled ES5 code
- What version of RJEA are you using (react-json-editor-ajrm version)? ^2.5.6
- What operating system and processor architecture are you using? MacOS Intel Core i5
- What did you do? Just tried to use (pollyfilled ES5 version as document here) the library to render a JSON field in a form. While it works in local env, it does not build because of Uglify plugin in our webpack config.
- What did you expect to see? As we are using the polyfilled ES5 version of the library, it should not produce the ES6 syntax which seems to be issue here.
- What did you see instead? Our app does not build because of the following error:
ERROR in main.63a5ae5adba0235e52d9.js from UglifyJs
Unexpected token: name (JSONInput) [main.63a5ae5adba0235e52d9.js:95191,6]
Hello @vikasrohit
Thank you for reporting this.
I'll flag this as a bug but I cannot give you an estimate to if/when this will be fixed since this library is currently unmaintained.
I'd advise to look for an alternate until a new maintainer can be found.
Thanks @PatrickSachs for the quick response.
I just encountered the same issue. Instead of importing 'react-json-editor-ajrm', you can import 'react-json-editor-ajrm/index' as a workaround. There seems to be an issue when you npm install this package. The module field in the installed package.json is ./es/index.js instead of index.js, so if you do import 'react-json-editor-ajrm' you are actually importing the es version
Thanks @napalm272 for the workaround and enlightening the root cause.
Thanks @napalm272 - worked for me!
@napalm272 thanks worked for me too!