AlexTatiyants / pev

Postgres Explain Visualizer
MIT License
2.77k stars 194 forks source link

Errors during npm start #22

Open lionelbarrow opened 7 years ago

lionelbarrow commented 7 years ago

Hey there,

First let me say thanks so much for this excellent tool, it's super useful. I was wondering if you could take a look at the error I've been running into during development.

The situation is:

The install works correctly. However, I see errors during TypeScript compilation:

[20:48:10] Starting 'build.js.dev'...
app/components/plan-node/plan-node.ts(167,40): error TS2304: Cannot find name '_'.
app/components/plan-node/plan-node.ts(257,38): error TS2304: Cannot find name '_'.
app/components/plan-node/plan-node.ts(262,22): error TS2304: Cannot find name '_'.
app/pipes.ts(7,16): error TS2304: Cannot find name 'moment'.
app/pipes.ts(19,24): error TS2304: Cannot find name '_'.
app/pipes.ts(21,24): error TS2304: Cannot find name '_'.
app/pipes.ts(23,24): error TS2304: Cannot find name '_'.
app/services/help-service.ts(1,1): error TS6053: File '/home/admin/bt/pev/app/services/lodash.d.ts' not found.
app/services/plan-service.ts(54,17): error TS2304: Cannot find name '_'.
app/services/plan-service.ts(59,16): error TS2304: Cannot find name '_'.
app/services/plan-service.ts(70,13): error TS2322: Type '{ id: string; name: string; createdOn: Date; content: any; query: any; }' is not assignable to type 'IPlan'.
  Property 'planStats' is missing in type '{ id: string; name: string; createdOn: Date; content: any; query: any; }'.
app/services/plan-service.ts(72,52): error TS2304: Cannot find name 'moment'.
app/services/plan-service.ts(115,9): error TS2304: Cannot find name '_'.
app/services/plan-service.ts(119,17): error TS2304: Cannot find name '_'.
app/services/plan-service.ts(154,9): error TS2304: Cannot find name '_'.
app/services/plan-service.ts(156,17): error TS2304: Cannot find name '_'.
app/services/plan-service.ts(169,9): error TS2304: Cannot find name '_'.
app/services/syntax-highlight-service.ts(1,1): error TS6053: File '/home/admin/bt/pev/app/services/highlight.d.ts' not found.
app/services/syntax-highlight-service.ts(2,1): error TS6053: File '/home/admin/bt/pev/app/services/lodash.d.ts' not found.
app/services/syntax-highlight-service.ts(9,9): error TS2304: Cannot find name 'hljs'.
app/services/syntax-highlight-service.ts(10,9): error TS2304: Cannot find name 'hljs'.
app/services/syntax-highlight-service.ts(18,9): error TS2304: Cannot find name '_'.
app/services/syntax-highlight-service.ts(22,18): error TS2304: Cannot find name 'hljs'.
[20:48:12] TypeScript: 23 semantic errors
[20:48:12] TypeScript: emit succeeded (with errors)
[20:48:12] Finished 'build.js.dev' after 1.47 s
[20:48:12] Starting 'build.index'...

Specifically it looks like the directives for lodash and moment are referencing files that don't exist. I couldn't find a step in the build pipeline that is supposed to put them there - is it possible they're missing?

Thanks again, Lionel

AlexTatiyants commented 7 years ago

Hi Lionel,

To be honest, my understanding of how these dependencies are resolved is murky at best. I think it happens in this file: https://github.com/AlexTatiyants/pev/blob/master/tools/config.ts