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
58 stars 18 forks source link

SyntaxError: Unexpected token export #23

Open ShailChoksi opened 7 years ago

ShailChoksi commented 7 years ago

My setup is: Typescript with node on Serverless (AWS lambda). Whenever I call one of the lambda functions, I get the following:

Serverless: Error while loading lambdaFunc
[ '...\\node_modules\\json-object-mapper\\dist\\ObjectMapper.es2015.js:637',
  'export { ObjectMapper, JsonProperty, JsonConverstionError, AccessType, CacheKey, JsonIgnore, DateSerializer };',
'SyntaxError: Unexpected token export',

The lambdaFunc file has the following:

import { ClassName1 } from "foo1";
import { ClassName2 } from "foo2";
import { ClassName3 } from "foo3";

and all those classes have: import { JsonProperty } from "json-object-mapper";

this works fine. And then as soon as I add this to the lambdaFunc: import { AnotherClass } from "foo4"; which has: import { ObjectMapper } from "json-object-mapper";

I get the error above.

shakilsiraj commented 6 years ago

Can you please try 1.5.2 ? This should be fixed there.