json-object-mapper icon indicating copy to clipboard operation
json-object-mapper copied to clipboard

SyntaxError: Unexpected token export

Open ShailChoksi opened this issue 8 years ago • 1 comments

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.

ShailChoksi avatar Aug 18 '17 18:08 ShailChoksi

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

shakilsiraj avatar Jan 22 '18 14:01 shakilsiraj