Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@melissarh57

Description

@melissarh57

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

`

[email protected] 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):

  • Node Version 16
  • OneTable Version: 2.6.3
  • TypeScript Version: 5.1.6 using "strict"

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedIssue has been fixed in the repo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions