Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example "account-without-juggler" does not work (anymore?) with NodeJS 10.10.0 #98

Open
koalabi opened this issue Oct 6, 2018 · 1 comment

Comments

@koalabi
Copy link

koalabi commented Oct 6, 2018

Tried above mentioned example (coming from the official Loopback 4 documentation (https://loopback.io/doc/en/lb4/Repositories.html).
Example crashes at runtime with message "Cannot start the app. Error: The key servers.RestServer was not bound to any value."
Googling and searching through the Loopback 4 documentation (such as https://loopback.io/doc/en/lb4/Server.html and https://loopback.io/doc/en/lb4/Application.html#servers) didn't help.

Versions:
Node: 10.10.0
npm: 6.4.1
TypeScript: tsc 2.8.3

package.json:
{
"name": "account",
"version": "1.0.0",
"description": "The Account microservice.",
"main": "index.ts",
"engines": {
"node": ">=8"
},
"dependencies": {
"@loopback/core": "^0.2.1",
"@loopback/repository": "^0.2.1",
"@loopback/rest": "^0.3.0",
"mysql": "^2.13.0",
"mysql-promise": "^4.1.0"
},
"devDependencies": {
"@loopback/testlab": "^0.4.0",
"@types/mocha": "^2.2.41",
"@types/node": "^8.0.47",
"debug": "^2.6.8",
"lodash": "^4.17.4",
"mocha": "^4.0.1",
"ts-node": "^3.0.4",
"tslint": "^5.4.3",
"typescript": "^2.4.1"
},
"scripts": {
"start": "ts-node index.ts",
"test": "mocha --opts test/mocha.opts 'test/unit/*.ts'"
},
"keywords": [
"loopback-next",
"example",
"account",
"microservice"
],
"repository": {
"type": "git",
"url": "git+https://github.com/strongloop/loopback4-example-microservices.git"
},
"bugs": {
"url": "https://github.com/strongloop/loopback4-example-microservices/issues"
},
"homepage": "https://github.com/strongloop/loopback4-example-microservices#readme",
"author": "IBM",
"license": "MIT"
}

Description/Steps to reproduce

git clone https://github.com/strongloop/loopback4-example-microservices.git
cd services/account-without-juggler
npm i
(fix minor bug in index.ts, l. 33: const port: Number = await rest.get(RestBindings.PORT) as Number;
npm start

application attempts to start but crashes with stacktrace:

alain@aegnor:/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler$ npm start

[email protected] start /media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler
ts-node index.ts

Cannot start the app. Error: The key servers.RestServer was not bound to any value.
at AccountMicroservice.getBinding (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/node_modules/@loopback/context/src/context.ts:379:11)
at AccountMicroservice.getValueOrPromise (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/node_modules/@loopback/context/src/context.ts:420:26)
at AccountMicroservice.get (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/node_modules/@loopback/context/src/context.ts:263:23)
at AccountMicroservice.getServer (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/node_modules/@loopback/core/src/application.ts:125:23)
at AccountMicroservice.info (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/index.ts:32:29)
at main (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/index.ts:46:46)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at Object. (/media/elrond_2tb/devel/strongloop/thirdparty/loopback4-example-microservices/services/account-without-juggler/node_modules/ts-node/src/_bin.ts:182:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:279:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: ts-node index.ts
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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! /home/alain/.npm/_logs/2018-10-06T20_29_14_826Z-debug.log

I cannot find how to bind the requested key to some value :-(

@koalabi koalabi changed the title Examle "account-without-juggler" does not work (anymore?) with NodeJS 10.10.0 Example "account-without-juggler" does not work (anymore?) with NodeJS 10.10.0 Oct 6, 2018
@koalabi
Copy link
Author

koalabi commented Oct 6, 2018

Trying with tsc 3.1.1 didn't change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant