sensedeep / dynamodb-onetable

DynamoDB access and management for one table designs with NodeJS
https://doc.onetable.io/
MIT License
690 stars 109 forks source link

"?boolean" in Table.d.ts triggers typescript build error #487

Closed melissarh57 closed 1 year ago

melissarh57 commented 1 year ago

Describe the bug

When I try to build my code using typescript it won't compile. I try building using "tsc -p tsconfig.json". On Typescript v4 the error I receive is "JSDoc types can only be used inside documentation comments." and in Typescript v5 the error is "'?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'boolean'?"

The error is occurring in node_modules/dynamodb-onetable/dist/mjs/Table.d.ts:100:29

To Reproduce

I created this repo to reproduce the bug. https://github.com/melissarh57/dynamodb-onetable-error/blob/main/README.md when running the command npm run build these are the output logs

`

dynamodb-onetable-error@1.0.0 build tsc -p tsconfig.json

node_modules/dynamodb-onetable/dist/mjs/Table.d.ts:17:30 - error TS2307: Cannot find module 'aws-lambda' or its corresponding type declarations.

17 import {DynamoDBRecord} from 'aws-lambda'


node_modules/dynamodb-onetable/dist/mjs/Table.d.ts:100:29 - error TS8020: JSDoc types can only be used inside documentation comments.

100         options?: {nothrow: ?boolean}

Found 2 errors in the same file, starting at: node_modules/dynamodb-onetable/dist/mjs/Table.d.ts:17 `

Steps to reproduce the behavior:

  1. Clone the repo listed above.
  2. run 'npm run build'
  3. see error log in console.

Expected behavior Can import Table and compile via typescript without errors

Environment (please complete the following information):

Additional context Please let me know if I missed any important info

Here is the offending code in Table.d.ts image

melissarh57 commented 1 year ago

PR: https://github.com/sensedeep/dynamodb-onetable/pull/488

mobsense commented 1 year ago

Thank you. Fixed.