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

Import ES6 does not work - client browser

Open half-metal opened this issue 3 years ago • 7 comments

Just as this issue pointed out, you get this specific module error https://github.com/andreyvit/json-diff/issues/46

Cannot assign to read only property 'name' of function 'function SequenceMatcher2(isjunk, a, b, autojunk) {
          this.isjunk = isjunk;
          if (a == null) {

This is just from the import example given in the readme and on npm import { diffString, diff } from 'json-diff'; Which means it's not usable on a client app in the browser. Is there a way to import this that works on browser. I'm using this with svelte/vite/javascript/chrome

half-metal avatar Apr 13 '22 04:04 half-metal

same happens to me with vite

Gabb1995 avatar Apr 26 '22 15:04 Gabb1995

And same here with Vue 3 + Vite.

chamberlainpi avatar May 04 '22 16:05 chamberlainpi

Try install @types/json-diff

minseolee avatar Jul 08 '22 02:07 minseolee

this is a runtime error and installing the type declaration package is not useful.

anilpixel avatar Nov 08 '22 07:11 anilpixel

And same here with Vite 3.x + React.

anilpixel avatar Nov 08 '22 07:11 anilpixel

Up, any news ?

AnthonyRuelle avatar May 23 '23 16:05 AnthonyRuelle

Up up ... the library seems to be outdated :(

AnthonyRuelle avatar Jun 26 '23 13:06 AnthonyRuelle