practica icon indicating copy to clipboard operation
practica copied to clipboard

Unable to run the quickstart as it failed at first run

Open ThomasG77 opened this issue 3 years ago • 0 comments

What I do?

mkdir demo-practica
cd demo-practica
git init . # To avoid "Command failed: npx turbo run build" due to missing .git and speedup install
npx @practica/create-node-app immediate --install-dependencies

It returns the following

❣️ Command failed: npx turbo run build
order-service:build: ERROR: command finished with error: command (services/order-service) npm run build exited (2)
command (services/order-service) npm run build exited (2)

• Packages in scope: @practica/configuration-provider, @practica/error-handling, @practica/jwt-token-verifier, @practica/logger, @practica/validation, order-service
• Running build in 6 packages
@practica/configuration-provider:build: cache miss, executing 8bc8fcc61119b8e7
@practica/validation:build: cache miss, executing 88eb730c59e11ded
@practica/jwt-token-verifier:build: cache miss, executing f3ee7b28707cce64
@practica/jwt-token-verifier:build: 
@practica/jwt-token-verifier:build: > @practica/[email protected] build
@practica/jwt-token-verifier:build: > tsc
@practica/jwt-token-verifier:build: 
@practica/configuration-provider:build: 
@practica/configuration-provider:build: > @practica/[email protected] build
@practica/configuration-provider:build: > tsc
@practica/configuration-provider:build: 
@practica/validation:build: 
@practica/validation:build: > @practica/[email protected] build
@practica/validation:build: > tsc
@practica/validation:build: 
@practica/logger:build: cache miss, executing 910860c0ba87745c
@practica/logger:build: 
@practica/logger:build: > @practica/[email protected] build
@practica/logger:build: > tsc
@practica/logger:build: 
@practica/error-handling:build: cache miss, executing f45817537faf2b9a
@practica/error-handling:build: 
@practica/error-handling:build: > @practica/[email protected] build
@practica/error-handling:build: > tsc
@practica/error-handling:build: 
order-service:build: cache miss, executing 2e3fe06d10230f3f
order-service:build: 
order-service:build: > [email protected] build
order-service:build: > tsc
order-service:build: 
order-service:build: domain/new-order-use-case.ts(43,3): error TS2578: Unused '@ts-expect-error' directive.
order-service:build: domain/order-schema.ts(1,8): error TS1192: Module '"/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/node_modules/@practica/validation/index"' has no default export.
order-service:build: entry-points/api/server.ts(18,5): error TS2578: Unused '@ts-expect-error' directive.

 Tasks:    5 successful, 6 total
Cached:    0 cached, 6 total
  Time:    4m14.391s 

Then, I do

cd services/order-service/
npm i
npm run start:dev

It crashs at it inherits from the issues from the first run

> [email protected] start:dev
> PORT=0 PRETTY_PRINT=true nodemon start.ts

[nodemon] 2.0.16
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts,json
[nodemon] starting `ts-node start.ts`
/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/node_modules/ts-node/src/index.ts:820
    return new TSError(diagnosticText, diagnosticCodes);
           ^
TSError: ⨯ Unable to compile TypeScript:
entry-points/api/server.ts:18:5 - error TS2578: Unused '@ts-expect-error' directive.

18     // @ts-expect-error TODO: fix this
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    at createTSError (/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/node_modules/ts-node/src/index.ts:820:12)
    at reportTSError (/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/node_modules/ts-node/src/index.ts:824:19)
    at getOutput (/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/node_modules/ts-node/src/index.ts:1014:36)
    at Object.compile (/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/node_modules/ts-node/src/index.ts:1322:43)
    at Module.m._compile (/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/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] (/home/thomasg/own-projects/demo-practica/default-app-name/services/order-service/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: [ 2578 ]
}
[nodemon] app crashed - waiting for file changes before starting...

PS: I'm a TypeScript noob so maybe obvious.

ThomasG77 avatar Aug 22 '22 18:08 ThomasG77