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 doesn't run #76

Open
danielpiedra opened this issue Oct 2, 2017 · 12 comments
Open

example doesn't run #76

danielpiedra opened this issue Oct 2, 2017 · 12 comments

Comments

@danielpiedra
Copy link

Description/Steps to reproduce

git clone https://github.com/strongloop/loopback-next-example
cd loopback-next-example
npm run build
npm start

Expected result

app example runs

Additional information

/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:296
        throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
              ^
TSError: ⨯ Unable to compile TypeScript
controllers/TransactionController.ts (1,10): Module '"/Users/danielq/Projects/Playground/loopback-next-example/services/transaction/node_modules/@loopback/core/index"' has no exported member 'api'. (2305)
    at getOutput (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:296:15)
    at /Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:325:16
    at Object.compile (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:479:11)
    at Module.m._compile (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:379:43)
    at Module._extensions..js (module.js:584:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:382:12)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)

@choeller
Copy link

Same here, but with different controller:

/home/christoph/sources/loopback/loopback-next-example/node_modules/ts-node/src/index.ts:307
        throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
              ^
TSError: ⨯ Unable to compile TypeScript
controllers/AccountManagementController.ts (1,10): Module '"/home/christoph/sources/loopback/loopback-next-example/services/facade/node_modules/@loopback/core/index"' has no exported member 'api'. (2305)
    at getOutput (/home/christoph/sources/loopback/loopback-next-example/node_modules/ts-node/src/index.ts:307:15)

node version is 7.7.4

@apapacy
Copy link

apapacy commented Oct 11, 2017

import { api } from '@loopback/core';
same error

@wolrajhti
Copy link

Install loopback/rest package for all services with npm install @loopback/rest --save

then replace import { api } from '@loopback/core'; by import { api } from '@loopback/rest';

and it should work

@apapacy
Copy link

apapacy commented Oct 18, 2017

thank you

@apapacy
Copy link

apapacy commented Oct 18, 2017

So. Im install @loopback/rest (4-alpha-3)
And bow have new error message

Cannot start the app. Error: The key http.port was not bound to any value.
at FacadeMicroservice.getBinding (/home/andrey/projects/loopback-next-example/services/facade/node_modules/@loopback/context/src/context.ts:153:11)

Is this repository active status?

@wolrajhti
Copy link

I solved this by adding the following in "services/facade/index.ts" at line 9 :
const app = this; app.bind('http.port').to(3004);

it seems to work but I don't understand next steps. It seems that app.start() starts all the Server of the application which seems not yet implemented..

Do you have the following messages when you run npm run build ?
npm WARN [email protected] No repository field
npm WARN [email protected] No repository field
npm WARN [email protected] No repository field
npm WARN [email protected] No repository field

Maybe the problem is here.

I'm still looking how to launch this example too

@suryacaprice
Copy link

module.js:540
throw err;
^

Error: Cannot find module 'D:\loopback-next-example'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

same here not running

@dhmlau
Copy link
Member

dhmlau commented Apr 17, 2018

@shimks , could you PTAL to see if the problem still exists after this PR had landed? thanks.

@shimks
Copy link
Contributor

shimks commented Apr 17, 2018

Last time I checked, the repo's able to start, but not everything is functional. See #94 for more details

@ex7r3me
Copy link

ex7r3me commented Oct 12, 2018

any news on this issue with loopback GA version?

@dhmlau
Copy link
Member

dhmlau commented Oct 14, 2018

@ex7r3me @suryacaprice @wolrajhti @apapacy @danielpiedra, sorry that we haven't been updating this repo. We've changed quite a lot since the last update. For now, if you would like to get some working example, you can the sample apps under https://github.com/strongloop/loopback-next/tree/master/examples, or a closer-to-real-life application: https://github.com/strongloop/loopback4-example-shopping.

I'd bring it up to the team on what's the best way to handle this repo. Thanks!

@AntonioAsr
Copy link

@dhmlau Hi,
Isn't the best for the community just to close this repo if it is not working?
I just wasted some time trying to get it to work ;(
Thank you

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

9 participants