shakilsiraj / json-object-mapper

A TypeScript library to serialize and deserialize object graph from/to JSON in a fast and non-recursive way
MIT License
59 stars 17 forks source link

SyntaxError: Unexpected token export #26

Open luzzif opened 7 years ago

luzzif commented 7 years ago

I'm pretty new to NodeJS and JS/TS development in general, and I'm lately facing this problem: when I try to compile and execute a little software of mine, the compilation terminates without any error whatsoever, while the execution throws the following error:

node_modules/json-object-mapper/dist/ObjectMapper.es2015.js:637
export { ObjectMapper, JsonProperty, JsonConverstionError, AccessType, CacheKey, JsonIgnore, DateSerializer };
^^^^^^

SyntaxError: Unexpected token export
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> 

My tsconfig.json is this one:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "outDir": "build",
        "sourceMap": true
    },
    "exclude": [
        "node_modules"
    ],
    "include": [
        "src/**/*.ts"
    ]
}

Is something wroong with the package or am I missing something obvious?

shakilsiraj commented 6 years ago

Hey @luzzif .. sorry about the late reply .. can you please try 1.5.2 and see if it's still an issue? thanks.