question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Error when compiling typescript

See original GitHub issue

Summary:

When I try compile the TS code with tsc -p ./tsconfig.json return some errors, see below

Code sample:

node_modules/dynamoose/dist/DocumentRetriever.d.ts:32:28 - error TS1110: Type expected.

32         sort?: SortOrder | `${SortOrder}`;
                              ~~~

node_modules/dynamoose/dist/DocumentRetriever.d.ts:33:5 - error TS1128: Declaration or statement expected.

33     };
       ~

node_modules/dynamoose/dist/DocumentRetriever.d.ts:34:58 - error TS1005: '(' expected.

34     getRequest: (this: DocumentRetriever) => Promise<any>;
                                                            ~

node_modules/dynamoose/dist/DocumentRetriever.d.ts:42:14 - error TS1005: ',' expected.

42     exec(this: DocumentRetriever, callback?: any): any;
                ~

node_modules/dynamoose/dist/DocumentRetriever.d.ts:42:44 - error TS1109: Expression expected.

42     exec(this: DocumentRetriever, callback?: any): any;
                                              ~

node_modules/dynamoose/dist/DocumentRetriever.d.ts:42:50 - error TS1005: ';' expected.

42     exec(this: DocumentRetriever, callback?: any): any;
                           

my tsconfig file

{
  "compilerOptions": {
    "skipLibCheck": true,
    "target": "es5",
    "module": "commonjs",
    "resolveJsonModule":true,
    "lib": ["dom", "es7"],
    "allowJs": true,
    "sourceMap": true,
    "outDir": "./dist",
    "strict": true,
    "noImplicitAny": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "strictNullChecks": false,
  },
  "include": [
    "**/*.js",
    "**/*.ts",
  ],
  "exclude": [
    "node_modules",
    "infra",
    "cypress"
  ]
}

Environment:

Operating System: Ubuntu Operating System Version: 20.04 Node.js version (node -v): 14.16.0 NPM version: (npm -v): 6.14.11 Dynamoose version: 2.8.5

Other:

  • [x ] I have read through the Dynamoose documentation before posting this issue
  • [ x] I have searched through the GitHub issues (including closed issues) and pull requests to ensure this issue has not already been raised before
  • [ x] I have searched the internet and Stack Overflow to ensure this issue hasn’t been raised or answered before
  • [x ] I have tested the code provided and am confident it doesn’t work as intended
  • I have filled out all fields above
  • I am running the latest version of Dynamoose

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fishcharliecommented, Jan 21, 2022

@MichelAraujo That’s your problem. Upgrade to the latest version of TypeScript and you should be good to go.

0reactions
fishcharliecommented, Jul 17, 2022

@lemankk Dynamoose v2.8.5 is running TypeScript ^4.3.5:

https://github.com/dynamoose/dynamoose/blob/1c8ee0ce027c58de153b216fb98978708e0700c6/package.json#L22

All of your screenshots are from a code editor. Which code editor are you using? Are you sure your Typescript within your code editor is up to date? Do you get these same error messages when actually running a Typescript build (ex. tsc from the command line)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Potential Typescript compiler bug? - Stack Overflow
It's not a compiler bug; it's a set of features that you are not intending to use. First, in interface and other purely...
Read more >
[Bug]: Typescript compilation errors cause Jest to hang silently ...
I expect Jest to output a compilation error or other indication that the test could not be run. Actual behavior. Jest hangs indefinitely....
Read more >
TS Playground - An online editor for exploring TypeScript and ...
An overview of building a TypeScript web app. TSConfig Options. All the configuration options for a project. Classes. How to provide types to...
Read more >
TypeScript tool window | WebStorm Documentation - JetBrains
The TypeScript tool window lists compilation errors in TypeScript code. This list is not affected by changes you make to your code and...
Read more >
TypeScript errors and how to fix them
To fix the problem you have to update the reference path to point to another ... error TS5024: Compiler option 'lib' requires a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found