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

TS unable to compile #1

Closed
ManuC84 opened this issue Aug 31, 2021 · 1 comment
Closed

TS unable to compile #1

ManuC84 opened this issue Aug 31, 2021 · 1 comment
Labels
question Further information is requested

Comments

@ManuC84
Copy link

ManuC84 commented Aug 31, 2021

Followed the instructions to a T but it keeps giving TS errors

[start:api:watch] [start:api:watch] C:\react-testing-starter\node_modules\ts-node\src\index.ts:587 [start:api:watch] return new TSError(diagnosticText, diagnosticCodes); [start:api:watch] ^ [start:api:watch] TSError: ⨯ Unable to compile TypeScript: [start:api:watch] backend/app.ts(79,11): error TS2769: No overload matches this call. [start:api:watch] The last overload gave the following error. [start:api:watch] Argument of type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to parameter of type 'PathParams'. [start:api:watch] Type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is missing the following properties from type '(string | RegExp)[]': pop, push, concat, join, and 27 more. [start:api:watch] backend/app.ts(89,11): error TS2769: No overload matches this call. [start:api:watch] The last overload gave the following error. [start:api:watch] Argument of type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to parameter of type 'PathParams'. [start:api:watch] Type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to type '(string | RegExp)[]'. [start:api:watch] backend/app.ts(94,11): error TS2769: No overload matches this call. [start:api:watch] The last overload gave the following error. [start:api:watch] Argument of type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to parameter of type 'PathParams'. [start:api:watch] Type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to type '(string | RegExp)[]'. [start:api:watch] [start:api:watch] at createTSError (C:\react-testing-starter\node_modules\ts-node\src\index.ts:587:12) [start:api:watch] at reportTSError (C:\react-testing-starter\node_modules\ts-node\src\index.ts:591:19) [start:api:watch] at getOutput (C:\react-testing-starter\node_modules\ts-node\src\index.ts:921:36) [start:api:watch] at Object.compile (C:\react-testing-starter\node_modules\ts-node\src\index.ts:1189:32) [start:api:watch] at Module.m._compile (C:\react-testing-starter\node_modules\ts-node\src\index.ts:1295:42) [start:api:watch] at module.exports (C:\react-testing-starter\node_modules\default-require-extensions\js.js:7:9) [start:api:watch] at C:\react-testing-starter\node_modules\append-transform\index.js:64:4 [start:api:watch] at require.extensions.<computed> (C:\react-testing-starter\node_modules\ts-node\src\index.ts:1298:12) [start:api:watch] at Object.<anonymous> (C:\react-testing-starter\node_modules\append-transform\index.js:64:4) [start:api:watch] at Module.load (internal/modules/cjs/loader.js:928:32)

@MitchelSt
Copy link
Owner

MitchelSt commented Aug 31, 2021

I saw your YouTube comment and the fix you found; awesome!

I'll just leave it here, should someone ever search trough the issues:

Had to comment out a bunch of middlewares on app.ts express file to get the app running, just in case this helps anyone

/* istanbul ignore if */
// if (process.env.REACT_APP_AUTH0) {
//   app.use(checkAuth0Jwt);
// }


/* istanbul ignore if */
// if (process.env.REACT_APP_AWS_COGNITO) {
//   app.use(checkCognitoJwt);
// }

/* istanbul ignore if */
// if (process.env.REACT_APP_GOOGLE) {
//   app.use(checkGoogleJwt);
// }

@MitchelSt MitchelSt added the question Further information is requested label Aug 31, 2021
@MitchelSt MitchelSt pinned this issue Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants