Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return User.findAll(whereClause) Fails with TSError: ⨯ Unable to compile TypeScript: When I remove Docker Files #236

Open
ChristianOConnor opened this issue Mar 16, 2022 · 0 comments

Comments

@ChristianOConnor
Copy link

I am building an app that incorporates the backend of this app with the Docker functionality removed. I only changed a few files.

  1. The package.json file: https://imgur.com/a/f0kfJZB
  2. The db.ts file: https://imgur.com/a/jr0ezuV
  3. Everything referencing Docker

Now I get this error in my terminal when I try to run the app in the backend folder with yarn start

<myusername>@<mycomputername> backend % yarn start
yarn run v1.22.17
$ ts-node src
(sequelize) Warning: SQLite does not support 'INTEGER' with UNSIGNED or ZEROFILL. Plain 'INTEGER' will be used instead. 
>> Check: https://www.sqlite.org/datatype3.html
/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:820
    return new TSError(diagnosticText, diagnosticCodes);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/services/users/controller.ts:14:22 - error TS2345: Argument of type '{ where: { publicAddress: string | ParsedQs | string[] | ParsedQs[]; }; } | undefined' is not assignable to parameter of type 'FindOptions<any> | undefined'.
  Type '{ where: { publicAddress: string | QueryString.ParsedQs | string[] | QueryString.ParsedQs[]; }; }' is not assignable to type 'FindOptions<any>'.
    Types of property 'where' are incompatible.
      Type '{ publicAddress: string | QueryString.ParsedQs | string[] | QueryString.ParsedQs[]; }' is not assignable to type 'WhereOptions<any> | undefined'.
        Type '{ publicAddress: string | QueryString.ParsedQs | string[] | QueryString.ParsedQs[]; }' is not assignable to type 'WhereAttributeHash<any>'.
          Type '{ publicAddress: string | QueryString.ParsedQs | string[] | QueryString.ParsedQs[]; }' is not assignable to type '{ [x: string]: string | number | bigint | boolean | Buffer | Fn | Col | Literal | WhereAttributeHash<any> | Date | WhereOperators | ... 6 more ... | undefined; }'.
            Property 'publicAddress' is incompatible with index signature.
              Type 'string | ParsedQs | string[] | ParsedQs[]' is not assignable to type 'string | number | bigint | boolean | Buffer | Fn | Col | Literal | WhereAttributeHash<any> | Date | WhereOperators | ... 6 more ... | undefined'.
                Type 'ParsedQs[]' is not assignable to type 'string | number | bigint | boolean | Buffer | Fn | Col | Literal | WhereAttributeHash<any> | Date | WhereOperators | ... 6 more ... | undefined'.
                  Type 'ParsedQs[]' is not assignable to type 'WhereAttributeHash<any>'.
                    Type 'ParsedQs[]' is not assignable to type '{ [x: string]: string | number | bigint | boolean | Buffer | Fn | Col | Literal | WhereAttributeHash<any> | Date | WhereOperators | ... 6 more ... | undefined; }'.
                      Index signature for type 'string' is missing in type 'ParsedQs[]'.

14  return User.findAll(whereClause)
                        ~~~~~~~~~~~

    at createTSError (/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:820:12)
    at reportTSError (/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:824:19)
    at getOutput (/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:1014:36)
    at Object.compile (/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:1322:43)
    at Module.m._compile (/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:1454:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/<myusername>/Desktop/Dev/nft-reactor-content/backend/node_modules/ts-node/src/index.ts:1458:12)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  diagnosticCodes: [ 2345 ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
<myusername>@<mycomputername> backend % 

Do you see what the problem is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant