Typescript errors
See original GitHub issueUsing OS X
If I run yarn watch
I get a bunch of typescript errors but the app runs successfully and I can access it at http://localhost:3000
If I run yarn watch:debug
the app blows up with the same errors.
I’m going to continue with the course using yarn watch
but I’d like to clear these up if possible 😃
This happens regardless of the db I use or whether I use npm run
vs yarn
npm run watch
(app runs with errors)
─(sc-gspake-osx)-(01:09 PM Sat May 12)->
└(~/Code/sql-fundamentals)--> npm run watch
> mikeworks-sql@0.0.0 watch /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/watch.sh":
> #!/usr/bin/env sh
> ./node_modules/.bin/nodemon -x "npm run build; npm start"
>
[nodemon] 1.17.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /Users/sc-gspake-osx/Code/sql-fundamentals/src/**/* /Users/sc-gspake-osx/Code/sql-fundamentals/views/**/* /Users/sc-gspake-osx/Code/sql-fundamentals/public/**/*
[nodemon] starting `npm run build; npm start`
> mikeworks-sql@0.0.0 build /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/build.sh":
> #!/usr/bin/env sh
> ./node_modules/.bin/tsc
node_modules/@types/handlebars/index.d.ts(28,9): error TS2687: All declarations of 'data' must have identical modifiers.
src/db/postgres-db.ts(77,27): error TS2345: Argument of type 'PoolClient' is not assignable to parameter of type 'Client'.
src/db/postgres-db.ts(101,30): error TS2339: Property 'release' does not exist on type 'Client'.
src/db/postgres-pubsub.ts(6,3): error TS2322: Type 'PoolClient' is not assignable to type 'Client'.
Property 'end' is missing in type 'PoolClient'.
src/types/handlebars.d.ts(13,5): error TS2717: Subsequent property declarations must have the same type. Property 'hash' must be of type 'any', but here has type '{ [key: string]: any; }'.
src/types/handlebars.d.ts(14,5): error TS2717: Subsequent property declarations must have the same type. Property 'fn' must be of type 'TemplateDelegate<any>', but here has type '(ctxt: any) => {}'.
src/types/handlebars.d.ts(15,5): error TS2687: All declarations of 'data' must have identical modifiers.
src/types/handlebars.d.ts(15,5): error TS2717: Subsequent property declarations must have the same type. Property 'data' must be of type 'any', but here has type '{ exphbs: ExpHbsState; root: { settings: any; request: Request; }; }'.
src/ws.ts(54,19): error TS2345: Argument of type '(this: WebSocket) => void' is not assignable to parameter of type '(this: WebSocket, ...args: any[]) => void'.
The 'this' types of each signature are incompatible.
Type 'WebSocket' is not assignable to type 'WebSocket'. Two different types with this name exist, but they are unrelated.
Property 'isAlive' is missing in type 'WebSocket'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mikeworks-sql@0.0.0 build: `scripty`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mikeworks-sql@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sc-gspake-osx/.npm/_logs/2018-05-12T18_22_26_892Z-debug.log
> mikeworks-sql@0.0.0 start /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/start.sh":
> #!/usr/bin/env sh
> node dist/index.js
info: Database Type: SQLite
info: Server listening on http://localhost:3000
npm run watch:debug
(app blows up)
┌─(sc-gspake-osx)-(01:06 PM Sat May 12)->
└(~/Code/sql-fundamentals)--> npm run watch:debug
> mikeworks-sql@0.0.0 watch:debug /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/watch/debug.sh":
> #!/usr/bin/env sh
> ./node_modules/.bin/nodemon -w src -e ts -x npm run bump
>
[nodemon] 1.17.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /Users/sc-gspake-osx/Code/sql-fundamentals/src/**/*
[nodemon] starting `npm run bump`
> mikeworks-sql@0.0.0 bump /Users/sc-gspake-osx/Code/sql-fundamentals
> npm run build && npm start
> mikeworks-sql@0.0.0 build /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/build.sh":
> #!/usr/bin/env sh
> ./node_modules/.bin/tsc
node_modules/@types/handlebars/index.d.ts(28,9): error TS2687: All declarations of 'data' must have identical modifiers.
src/db/postgres-db.ts(77,27): error TS2345: Argument of type 'PoolClient' is not assignable to parameter of type 'Client'.
src/db/postgres-db.ts(101,30): error TS2339: Property 'release' does not exist on type 'Client'.
src/db/postgres-pubsub.ts(6,3): error TS2322: Type 'PoolClient' is not assignable to type 'Client'.
Property 'end' is missing in type 'PoolClient'.
src/types/handlebars.d.ts(13,5): error TS2717: Subsequent property declarations must have the same type. Property 'hash' must be of type 'any', but here has type '{ [key: string]: any; }'.
src/types/handlebars.d.ts(14,5): error TS2717: Subsequent property declarations must have the same type. Property 'fn' must be of type 'TemplateDelegate<any>', but here has type '(ctxt: any) => {}'.
src/types/handlebars.d.ts(15,5): error TS2687: All declarations of 'data' must have identical modifiers.
src/types/handlebars.d.ts(15,5): error TS2717: Subsequent property declarations must have the same type. Property 'data' must be of type 'any', but here has type '{ exphbs: ExpHbsState; root: { settings: any; request: Request; }; }'.
src/ws.ts(54,19): error TS2345: Argument of type '(this: WebSocket) => void' is not assignable to parameter of type '(this: WebSocket, ...args: any[]) => void'.
The 'this' types of each signature are incompatible.
Type 'WebSocket' is not assignable to type 'WebSocket'. Two different types with this name exist, but they are unrelated.
Property 'isAlive' is missing in type 'WebSocket'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mikeworks-sql@0.0.0 build: `scripty`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mikeworks-sql@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sc-gspake-osx/.npm/_logs/2018-05-12T18_09_03_670Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mikeworks-sql@0.0.0 bump: `npm run build && npm start`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mikeworks-sql@0.0.0 bump script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sc-gspake-osx/.npm/_logs/2018-05-12T18_09_03_696Z-debug.log
[nodemon] process failed, unhandled exit code (2)
[nodemon] Error
at Bus.utils.bus.on (/Users/sc-gspake-osx/Code/sql-fundamentals/node_modules/nodemon/lib/nodemon.js:148:25)
at emitOne (events.js:121:20)
at Bus.emit (events.js:211:7)
at ChildProcess.<anonymous> (/Users/sc-gspake-osx/Code/sql-fundamentals/node_modules/nodemon/lib/monitor/run.js:164:11)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
using postgres
┌─(sc-gspake-osx)-(01:23 PM Sat May 12)->
└(~/Code/sql-fundamentals)--> DB_TYPE=pg npm run watch
> mikeworks-sql@0.0.0 watch /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/watch.sh":
> #!/usr/bin/env sh
> ./node_modules/.bin/nodemon -x "npm run build; npm start"
>
[nodemon] 1.17.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /Users/sc-gspake-osx/Code/sql-fundamentals/src/**/* /Users/sc-gspake-osx/Code/sql-fundamentals/views/**/* /Users/sc-gspake-osx/Code/sql-fundamentals/public/**/*
[nodemon] starting `npm run build; npm start`
> mikeworks-sql@0.0.0 build /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/build.sh":
> #!/usr/bin/env sh
> ./node_modules/.bin/tsc
node_modules/@types/handlebars/index.d.ts(28,9): error TS2687: All declarations of 'data' must have identical modifiers.
src/db/postgres-db.ts(77,27): error TS2345: Argument of type 'PoolClient' is not assignable to parameter of type 'Client'.
src/db/postgres-db.ts(101,30): error TS2339: Property 'release' does not exist on type 'Client'.
src/db/postgres-pubsub.ts(6,3): error TS2322: Type 'PoolClient' is not assignable to type 'Client'.
Property 'end' is missing in type 'PoolClient'.
src/types/handlebars.d.ts(13,5): error TS2717: Subsequent property declarations must have the same type. Property 'hash' must be of type 'any', but here has type '{ [key: string]: any; }'.
src/types/handlebars.d.ts(14,5): error TS2717: Subsequent property declarations must have the same type. Property 'fn' must be of type 'TemplateDelegate<any>', but here has type '(ctxt: any) => {}'.
src/types/handlebars.d.ts(15,5): error TS2687: All declarations of 'data' must have identical modifiers.
src/types/handlebars.d.ts(15,5): error TS2717: Subsequent property declarations must have the same type. Property 'data' must be of type 'any', but here has type '{ exphbs: ExpHbsState; root: { settings: any; request: Request; }; }'.
src/ws.ts(54,19): error TS2345: Argument of type '(this: WebSocket) => void' is not assignable to parameter of type '(this: WebSocket, ...args: any[]) => void'.
The 'this' types of each signature are incompatible.
Type 'WebSocket' is not assignable to type 'WebSocket'. Two different types with this name exist, but they are unrelated.
Property 'isAlive' is missing in type 'WebSocket'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mikeworks-sql@0.0.0 build: `scripty`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mikeworks-sql@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sc-gspake-osx/.npm/_logs/2018-05-12T18_24_05_825Z-debug.log
> mikeworks-sql@0.0.0 start /Users/sc-gspake-osx/Code/sql-fundamentals
> scripty
Executing "/Users/sc-gspake-osx/Code/sql-fundamentals/scripts/start.sh":
> #!/usr/bin/env sh
> node dist/index.js
info: Database Type: PostgreSQL
info: Server listening on http://localhost:3000
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >TypeScript errors and how to fix them
TypeScript errors and how to fix them. Common Errors. Below you find a list of common TypeScript errors along with the buggy code...
Read more >Interpreting Errors - TypeScript Deep Dive - Gitbook
Since TypeScript is a heavily focused Developer Help oriented programming language, its errors messages try to be super helpful when something goes wrong....
Read more >Understanding TypeScript Errors for Beginners
A pretty common issue that new TypeScript developers encounter in a TypeScript based project is the “Could not find declaration file for module…...
Read more >Improving TypeScript error handling with exhaustive type ...
Discover an improved method for handling errors in TypeScript that solves problems that arise from returning null and throwing try...catch.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/winstonjs/winston/issues/1101 npm i winston@next --save DB_TYPE=pg npm run watch The issue is resovled after updating the winston.
Latest release should have no typescript errors