serialize-json icon indicating copy to clipboard operation
serialize-json copied to clipboard

Code Doesn't Compile

Open HoldOffHunger opened this issue 8 years ago • 2 comments

Hi, there,

It seems that the code does not compile in serialize-json.

static/js/main.7ceea777.js from UglifyJs
Unexpected token: name (JSONDecoder) [./~/serialize-json/lib/decoder.js:21,0][static/js/main.7ceea777.js:55947,6]

Thanks!

HoldOffHunger avatar Aug 21 '17 17:08 HoldOffHunger

Just a note, to others who find themselves stuck on this problem:

The following NPM package turned out to be optimal for my solution: https://www.npmjs.com/package/json-cycle

HoldOffHunger avatar Aug 21 '17 18:08 HoldOffHunger

The problem is that the decoder file uses class keyword which uglify can not understand. The module needs to be bundled via webpack or something like this so it gets transpiled to ES5.

krasimir avatar Dec 13 '17 15:12 krasimir