Skip to content

SyntaxError: Unexpected token export #26

Open
@luzzif

Description

@luzzif

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions