Search code examples
wavesplatform

data-service Compiling and running versions greater than 0.18.1


I can't start the API starting from version 0.18.1. Example version 0.20.0 I get an error:

/home/ubuntu/data-service/node_modules/ts-node/src/index.ts:261 return new TSError(diagnosticText, diagnosticCodes) ^ TSError: ⨯ Unable to compile TypeScript: src/index.ts(15,34): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. src/index.ts(26,35): error TS2345: Argument of type '{ expose: string; header: boolean; }' is not assignable to parameter of type '{ expose?: string | undefined; header?: string | undefined; query?: string | undefined; }'. Types of property 'header' are incompatible. Type 'boolean' is not assignable to type 'string | undefined'.

I tried different versions in different variants. But the errors are almost the same. what versions and what do you use for compilation? Maybe I am launching wrong? There is one nuance that makes me roll back to [email protected] Because it is needed for ts-jest. How correct?


Solution

  • We don't actually use ts-node to launch the app. One of the reasons we've stopped using it is that it sometimes produces cryptic errors even when the tsc compiles fine.

    Try launching this way (requires ENV vars):

    npm run build
    node dist/index.js