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

Getting typings errors even though the typeRoots are set in my tsconfig. #66

Open
flleeppyy opened this issue Mar 8, 2021 · 1 comment

Comments

@flleeppyy
Copy link

"dev": "browser-refresh --require ts-node/register ./src/index.ts"

This is the command im using to run my servers backend.

"__dev": "cross-env nodemon --ext 'ts' --watch 'src' --exec 'cross-env NODE_ENV=development PORT=8080 ts-node --files ./src/index.ts'",

This is the old dev command I was using before trying browser-refresh

When running browser-refresh, i get typing errors, even though it was working perfectly before I used browser-refresh

/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:513
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/index.ts:114:40 - error TS2339: Property 'realIp' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.

114     if (ipffffSplit !== undefined) req.realIp = ipffffSplit; else req.realIp = ip;
                                           ~~~~~~
src/index.ts:114:71 - error TS2339: Property 'realIp' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.

114     if (ipffffSplit !== undefined) req.realIp = ipffffSplit; else req.realIp = ip;
                                                                          ~~~~~~

    at createTSError (/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:513:12)
    at reportTSError (/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:517:19)
    at getOutput (/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:752:36)
    at Object.compile (/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:968:32)
    at Module.m._compile (/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:1056:42)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.require.extensions.<computed> [as .ts] (/media/chen/storage/development/urlshortener/backend/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
App stopped unexpectedly

This is my tsconfig.json

{
  "compilerOptions": {
    "allowJs": false,
    "allowSyntheticDefaultImports": true,
    "alwaysStrict": true,
    "baseUrl": "./src",
    "checkJs": false,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "importsNotUsedAsValues": "error",
    "incremental": true,
    "lib": ["es2020"],
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmit": false,
    "noEmitOnError": true,
    "noImplicitAny": true,
    "noImplicitReturns": false,
    "noImplicitThis": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    // "outDir": "./dist",
    "pretty": false,
    "removeComments": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "sourceMap": false,
    "strict": true,
    "strictBindCallApply": true,
    "strictNullChecks": false,
    "suppressImplicitAnyIndexErrors": true,
    "inlineSourceMap": true,
    "target": "es2020",
    "typeRoots": ["./src/typings", "./node_modules/@types"],
  },
  "exclude": ["node_modules"],
  "include": ["./src/**/*"]
}

What's the problem here?

@flleeppyy
Copy link
Author

I just realised this package is dead
rip

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