Open jeffreyabecker opened 5 years ago
I just checked with a plain TS project and it seems to work as expected with fast-json-patch 3.0.0-1
.
I think that TypeScript works well with MJS as long as you have a current version of TSC. Any idea what's different in your setup?
Source: https://github.com/warpech/fast-json-patch-typescript-demo
(it's actually pretty similar to https://github.com/Starcounter-Jack/JSON-Patch/blob/18a14f0b7d4e567ef605d21dd681718968d642e5/test/spec/typings/typingsSpec.ts)
The biggest difference I notice from that repo is that my ts code contains a line
import * as jsonpatch from "fast-json-patch"
Is it possible that you've not pushed something?
Sorry, I forgot to push my final version of the files to https://github.com/warpech/fast-json-patch-typescript-demo
Now I have pushed it and the wildcard import works OK: https://github.com/warpech/fast-json-patch-typescript-demo/blob/b2a668291ba0701ec3bfaed97823f815c125bd45/index.ts#L2
I have to believe this issue can be closed at this point?
I'm getting an error when trying to import v 3.0.0:
ERROR in ./node_modules/fast-json-patch/index.mjs Module parse failed: Unexpected token (25:4) You may need an appropriate loader to handle this file type.
as far as I can tell this is related to how typescript deals with .mjs files. However the package itself doesnt appear to have the source typescript files to use directly.