Skip to content

SyntaxError: Unexpected token export #23

Open
@ShailChoksi

Description

@ShailChoksi

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.

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