ES6 syntax in polyfilled ES5 code
See original GitHub issue- 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]
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Polyfills and transpilers - The Modern JavaScript Tutorial
A transpiler is a special piece of software that translates source code to another source code. It can parse (“read and understand”) modern...
Read more >es6-articles/50 - Polyfilling ES6 for Older Browsers.md at master
We just learned that Babel takes our ES6 code and compiles it down to ES5 code, ... Babel only works on syntax, meaning...
Read more >Javascript: ES6+ to ES5 with Babel - Byteridge
Transform syntax, Polyfill features that are missing in your target environment (through @babel/polyfill); Source code transformations ...
Read more >Can I target ES6 with Typescript if I am using babel-polyfill?
Does babel-polyfill provide the same level of ES5 support as transpiling to an ES5 target? No. babel-polyfill adds missing ES6 runtime ...
Read more >ES5 vs ES6 ( With example code ). We have came so far
Arrow functions brought a lot of clarity & code reduction to… ... and importing module syntax changed completely with the introduction of ES6...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 ofindex.js
, so if you do import ‘react-json-editor-ajrm’ you are actually importing the es version@napalm272 thanks worked for me too!