0

Problem

I'm using Typescript with @aws/dynamodb-data-mapper-annotations, and it works but keeps throwing compile errors. These errors occurred on both macOS and Ubuntu 16.04 :

../../node_modules/@aws/dynamodb-data-mapper/build/protocols.d.ts(31,45): error TS1005: '=' expected.

31 export declare const DynamoDbSchema: unique symbol;
                                               ~~~~~~



../../node_modules/@aws/dynamodb-data-mapper/build/protocols.d.ts(52,44): error TS1005: '=' expected.

52 export declare const DynamoDbTable: unique symbol;
                                              ~~~~~~


../../node_modules/@aws/dynamodb-data-mapper/build/protocols.d.ts(81,50): error TS1005: '=' expected.

81 export declare const DynamoDbDirtyFields: unique symbol;
                                                    ~~~~~~

Does anyone know how to fix it? I appreciate your help. :)

Settings

I've added node_modules as excluded folder in tsconfig.json, and here are my settings:

  • tsc: 2.8.1
  • npm: 5.3.0
  • aws-sdk: 2.318.0
  • @aws/dynamodb-data-mapper-annotations: 0.7.3
zeck
  • 769
  • 1
  • 7
  • 13
  • 1
    It looks like TypeScript is having trouble parsing the `unique symbol` type. That type was added in TypeScript 2.7. You must be using a TypeScript version older than 2.7 somewhere, even though you say you are using 2.8.1. How are you building the project? Just `tsc` at the command line? If so, check `tsc --version`. – Matt McCutchen Sep 22 '18 at 23:09

1 Answers1

0

Thanks to Matt's comment. I resolves it by using newer version of Typescript.

zeck
  • 769
  • 1
  • 7
  • 13