react-json-editor-ajrm icon indicating copy to clipboard operation
react-json-editor-ajrm copied to clipboard

ES6 syntax in polyfilled ES5 code

Open vikasrohit opened this issue 6 years ago • 6 comments

  1. What version of RJEA are you using (react-json-editor-ajrm version)? ^2.5.6
  2. What operating system and processor architecture are you using? MacOS Intel Core i5
  3. 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.
  4. 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.
  5. 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]

vikasrohit avatar Jan 02 '19 07:01 vikasrohit

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.

SachsKaylee avatar Jan 02 '19 17:01 SachsKaylee

Thanks @PatrickSachs for the quick response.

vikasrohit avatar Jan 03 '19 05:01 vikasrohit

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

napalm272 avatar Feb 14 '19 19:02 napalm272

Thanks @napalm272 for the workaround and enlightening the root cause.

vikasrohit avatar Feb 15 '19 05:02 vikasrohit

Thanks @napalm272 - worked for me!

akratzel avatar Feb 25 '19 07:02 akratzel

@napalm272 thanks worked for me too!

shpsi avatar May 20 '19 10:05 shpsi