moleculer-template-project-typescript
moleculer-template-project-typescript copied to clipboard
Unable to compile TypeScript
Dear,
Could you please help me in advance, I am facing with error unable to compile TS.

Hi, i have the same issue. Any solutions?
Hi. You're using REPL v0.7.1, right? Can you set replCommands: [] instead of null?
I also set replCommands: [ ], but it's still an error. Seem the file molecluer.config.ts is missing something...
I have moleculer-repl v0.6.6. I did npm outdate and moleculer-repl wasn't on the list of candidates for update. But the docs said that the current version is v0.7.1.. I also tried to instal specific version v0.7.1., but failed. My current
I have moleculer-repl v0.6.6. I did npm outdate and moleculer-repl wasn't on the list of candidates for update. But the docs said that the current version is v0.7.1.. I also tried to instal specific version v0.7.1., but failed. My current config: nodejs 14.15.4 package.json
`{ "name": "geo_service", "version": "1.0.0", "description": "My Moleculer-based microservices project", "scripts": { "build": "tsc --build tsconfig.json", "dev": "ts-node ./node_modules/moleculer/bin/moleculer-runner.js --hot --repl --config moleculer.config.ts services//*.service.ts", "start": "moleculer-runner --config dist/moleculer.config.js", "cli": "moleculer connect NATS", "ci": "jest --watch", "test": "jest --coverage", "lint": "eslint --ext .js,.ts .", "dc:up": "docker-compose up --build -d", "dc:logs": "docker-compose logs -f", "dc:down": "docker-compose down" }, "keywords": [ "microservices", "moleculer" ], "author": "", "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.26.0", "@typescript-eslint/parser": "^2.26.0", "eslint": "^6.8.0", "eslint-plugin-import": "^2.20.2", "eslint-plugin-prefer-arrow": "^1.2.2", "jest": "^25.1.0", "jest-cli": "^25.1.0", "moleculer-repl": "^0.6.6", "ts-jest": "^25.3.0", "ts-node": "^8.8.1" }, "dependencies": { "moleculer-web": "^0.9.0", "moleculer-db": "^0.8.4", "moleculer-db-adapter-mongo": "^0.4.7", "nats": "^1.3.2", "moleculer": "^0.14.0", "typescript": "^3.8.3", "@types/jest": "^25.1.4", "@types/mkdirp": "^1.0.0", "@types/node": "^13.9.8" }, "engines": { "node": ">= 10.x.x" }, "jest": { "coverageDirectory": "<rootDir>/coverage", "testEnvironment": "node", "moduleFileExtensions": [ "ts", "tsx", "js" ], "transform": { "^.+\.(ts|tsx)$": "ts-jest" }, "testMatch": [ "/*.spec.(ts|js)" ], "globals": { "ts-jest": { "tsConfig": "tsconfig.json" } } } }
`
My temporary solution to fix it:
//moleculer.config.ts
import {
BrokerOptions, Errors, MetricRegistry, ServiceBroker,
} from 'moleculer';
interface UpdatedBrokerOptions extends BrokerOptions {
replCommands: any;
}
...
const brokerConfig: UpdatedBrokerOptions = {
...
replCommands: [],
...
}