Loopback-next: Todo-List example does not build in a cloned git repository

Created on 3 Oct 2018  路  15Comments  路  Source: strongloop/loopback-next

Description / Steps to reproduce / Feature proposal

Clone the loopback-next Git repository; cd to examples/todo-list; npm start -> transpilation errors in several .ts files

node: 10.0.0
npm: 6.4.1
tsc: 3.1.1
OS: Ubuntu 16.04LTS

Current Behavior

alain@aegnor:\~/devel/thirdparty-use$ git clone https://github.com/strongloop/loopback-next.git
Cloning into 'loopback-next'...
remote: Enumerating objects: 70, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 24569 (delta 37), reused 37 (delta 20), pack-reused 24499
Receiving objects: 100% (24569/24569), 8.64 MiB | 6.11 MiB/s, done.
Resolving deltas: 100% (18223/18223), done.
Checking connectivity... done.
alain@aegnor:\~/devel/thirdparty-use$ cd loopback-next/
alain@aegnor:\~/devel/thirdparty-use/loopback-next$ ls -ltr
total 72
-rw-rw-r-- 1 alain alain 5265 oct 3 18:55 README.md
-rw-rw-r-- 1 alain alain 1195 oct 3 18:55 LICENSE
-rw-rw-r-- 1 alain alain 1141 oct 3 18:55 CODEOWNERS
-rw-rw-r-- 1 alain alain 122 oct 3 18:55 CHANGELOG.md
-rw-rw-r-- 1 alain alain 308 oct 3 18:55 appveyor.yml
-rw-rw-r-- 1 alain alain 554 oct 3 18:55 commitlint.config.js
drwxrwxr-x 2 alain alain 4096 oct 3 18:55 bin
drwxrwxr-x 4 alain alain 4096 oct 3 18:55 benchmark
drwxrwxr-x 4 alain alain 4096 oct 3 18:55 docs
drwxrwxr-x 8 alain alain 4096 oct 3 18:55 examples
-rw-rw-r-- 1 alain alain 2729 oct 3 18:55 package.json
-rw-rw-r-- 1 alain alain 648 oct 3 18:55 lerna.json
-rw-rw-r-- 1 alain alain 257 oct 3 18:55 tslint.json
-rw-rw-r-- 1 alain alain 256 oct 3 18:55 tslint.build.json
-rw-rw-r-- 1 alain alain 292 oct 3 18:55 tsconfig.json
drwxrwxr-x 3 alain alain 4096 oct 3 18:55 sandbox
drwxrwxr-x 20 alain alain 4096 oct 3 18:55 packages
alain@aegnor:\~/devel/thirdparty-use/loopback-next$ cd examples/
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples$ ls -ltr
total 24
drwxrwxr-x 5 alain alain 4096 oct 3 18:55 hello-world
drwxrwxr-x 7 alain alain 4096 oct 3 18:55 todo-list
drwxrwxr-x 5 alain alain 4096 oct 3 18:55 soap-calculator
drwxrwxr-x 5 alain alain 4096 oct 3 18:55 rpc-server
drwxrwxr-x 5 alain alain 4096 oct 3 18:55 log-extension
drwxrwxr-x 6 alain alain 4096 oct 3 18:55 todo
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples$ cd todo-list/
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ ls -ltr
total 60
-rw-rw-r-- 1 alain alain 129 oct 3 18:55 tslint.json
-rw-rw-r-- 1 alain alain 128 oct 3 18:55 tslint.build.json
-rw-rw-r-- 1 alain alain 220 oct 3 18:55 tsconfig.build.json
drwxrwxr-x 4 alain alain 4096 oct 3 18:55 test
drwxrwxr-x 6 alain alain 4096 oct 3 18:55 src
-rw-rw-r-- 1 alain alain 3356 oct 3 18:55 README.md
-rw-rw-r-- 1 alain alain 2161 oct 3 18:55 package.json
-rw-rw-r-- 1 alain alain 1204 oct 3 18:55 LICENSE
-rw-rw-r-- 1 alain alain 315 oct 3 18:55 index.ts
-rw-rw-r-- 1 alain alain 490 oct 3 18:55 index.js
-rw-rw-r-- 1 alain alain 233 oct 3 18:55 index.d.ts
drwxrwxr-x 2 alain alain 4096 oct 3 18:55 imgs
drwxrwxr-x 2 alain alain 4096 oct 3 18:55 data
-rw-rw-r-- 1 alain alain 5524 oct 3 18:55 CHANGELOG.md
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm install
npm WARN deprecated [email protected]: no longer maintained
added 624 packages from 1417 contributors and audited 3141 packages in 10.386s
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm start

@loopback/[email protected] prestart /media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list
npm run build

@loopback/[email protected] build /media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list
lb-tsc

src/models/todo-list.model.ts:28:12 - error TS2345: Argument of type '() => typeof Todo' is not assignable to parameter of type 'typeof Entity'.
Property 'getIdOf' is missing in type '() => typeof Todo'.

28 @hasMany(() => Todo)
\~\~\~\~\~\~\~\~\~\~

src/models/todo-list.model.ts:28:12
28 @hasMany(() => Todo)
\~\~\~\~\~\~\~\~\~\~
Did you mean to call this expression?

src/repositories/todo-list.repository.ts:24:17 - error TS2339: Property 'getter' does not exist on type '{ (repositoryName: string | Class>): RepositoryDecorator; (model: string | typeof Entity, dataSource: string | DataSource): RepositoryDecorator; }'.

24 @repository.getter(TodoRepository)
\~\~\~\~\~\~

src/repositories/todo-list.repository.ts:30:7 - error TS2345: Argument of type 'Getter' is not assignable to parameter of type 'EntityCrudRepository Property 'save' is missing in type 'Getter'.

30 todoRepositoryGetter,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list-todo.controller.unit.ts:11:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

11 createStubInstance,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list-todo.controller.unit.ts:14:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

14 StubbedInstanceWithSinonAccessor,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list.controller.unit.ts:7:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

7 createStubInstance,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list.controller.unit.ts:10:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

10 StubbedInstanceWithSinonAccessor,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo.controller.unit.ts:7:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

7 createStubInstance,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo.controller.unit.ts:10:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

10 StubbedInstanceWithSinonAccessor,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @loopback/[email protected] build: lb-tsc
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @loopback/[email protected] build 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-03T16_56_25_596Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @loopback/[email protected] prestart: npm run build
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @loopback/[email protected] prestart 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-03T16_56_25_621Z-debug.log
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ rm -rf node_modules/
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm install
npm WARN deprecated [email protected]: no longer maintained
added 624 packages from 1417 contributors and audited 3141 packages in 7.453s
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm audit fix
npm ERR! code EAUDITNOLOCK
npm ERR! audit Neither npm-shrinkwrap.json nor package-lock.json found: Cannot audit a project without a lockfile
npm ERR! audit Try creating one first with: npm i --package-lock-only

npm ERR! A complete log of this run can be found in:
npm ERR! /home/alain/.npm/_logs/2018-10-03T16_57_05_101Z-debug.log
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm i --package-lock-only
audited 3141 packages in 2.929s
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
alain@aegnor:\~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm start

@loopback/[email protected] prestart /media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list
npm run build

@loopback/[email protected] build /media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list
lb-tsc

src/models/todo-list.model.ts:28:12 - error TS2345: Argument of type '() => typeof Todo' is not assignable to parameter of type 'typeof Entity'.
Property 'getIdOf' is missing in type '() => typeof Todo'.

28 @hasMany(() => Todo)
\~\~\~\~\~\~\~\~\~\~

src/models/todo-list.model.ts:28:12
28 @hasMany(() => Todo)
\~\~\~\~\~\~\~\~\~\~
Did you mean to call this expression?

src/repositories/todo-list.repository.ts:24:17 - error TS2339: Property 'getter' does not exist on type '{ (repositoryName: string | Class>): RepositoryDecorator; (model: string | typeof Entity, dataSource: string | DataSource): RepositoryDecorator; }'.

24 @repository.getter(TodoRepository)
\~\~\~\~\~\~

src/repositories/todo-list.repository.ts:30:7 - error TS2345: Argument of type 'Getter' is not assignable to parameter of type 'EntityCrudRepository Property 'save' is missing in type 'Getter'.

30 todoRepositoryGetter,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list-todo.controller.unit.ts:11:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

11 createStubInstance,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list-todo.controller.unit.ts:14:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

14 StubbedInstanceWithSinonAccessor,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list.controller.unit.ts:7:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

7 createStubInstance,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo-list.controller.unit.ts:10:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

10 StubbedInstanceWithSinonAccessor,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo.controller.unit.ts:7:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

7 createStubInstance,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

test/unit/controllers/todo.controller.unit.ts:10:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

10 StubbedInstanceWithSinonAccessor,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @loopback/[email protected] build: lb-tsc
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @loopback/[email protected] build 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-03T16_57_36_626Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @loopback/[email protected] prestart: npm run build
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @loopback/[email protected] prestart 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-03T16_57_36_652Z-debug.log

Expected Behavior

A correct build and run

Most helpful comment

Thanks @marioestradarosa for chiming in and helping @koalabi 馃憤. Great discussion, and yes the example todo application doesn't have the home page html/controller that @raymondfeng recently introduced into our templates (I have confirmed that it returns a 404). This might be a good indication that we need it for all of our examples (thoughts @marioestradarosa @raymondfeng @bajtos @strongloop/sq-lb-apex?). @koalabi for now, you can go to the API explorer if you have a browser at http://localhost:3000/explorer and check out the REST API endpoints.

All 15 comments

@koalabi Thank you for bringing this to our attention. Can you let me know your node and npm versions? I am not able to reproduce the issue. Also, can you remove your node_modules folder and give it another try? Another option you can try if you just want the todo-list example application is to install @loopback/cli globally and run lb4 example and select it from the list.

@koalabi , have you tried to scaffold it using lb4 example ? (quoting b-admike here 馃槃 ). I got your node version 10.0.0 right?, I just tried now and it is working for me running this command, I am running node 10 and npm 6.4.1 for you reference.

On a separate note, the @b-admike fix and mine on lb4 repository are already published on lb4 CLI version 0.28.0 , please provide any feedback on that also whenever you have time.

@b-admike,
Waow! this is a fast reaction ;-)
Versions are indicated in the original post.

Retry after suppressing node_modules fails reproducibly (see below) [1]
Building example using "lb4 example" and selecting "ToDo-List" builds successfully but returns a 404 error upon invocation in the browser !? [2]

[1] ==============
alain@aegnor:~/devel/thirdparty-use/loopback-next/examples/todo-list$ rm -rf node_modules/
alain@aegnor:~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm i
npm WARN deprecated [email protected]: no longer maintained
added 632 packages from 1417 contributors and audited 3150 packages in 18.856s
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
alain@aegnor:~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm audit fix
npm ERR! code EAUDITNOLOCK
npm ERR! audit Neither npm-shrinkwrap.json nor package-lock.json found: Cannot audit a project without a lockfile
npm ERR! audit Try creating one first with: npm i --package-lock-only

npm ERR! A complete log of this run can be found in:
npm ERR! /home/alain/.npm/_logs/2018-10-03T18_49_55_068Z-debug.log
alain@aegnor:~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm i --package-lock-only
audited 3150 packages in 3.406s
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
alain@aegnor:~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm audit fix
npm ERR! code EAUDITNOLOCK
npm ERR! audit Neither npm-shrinkwrap.json nor package-lock.json found: Cannot audit a project without a lockfile
npm ERR! audit Try creating one first with: npm i --package-lock-only

npm ERR! A complete log of this run can be found in:
npm ERR! /home/alain/.npm/_logs/2018-10-03T18_50_15_925Z-debug.log
alain@aegnor:~/devel/thirdparty-use/loopback-next/examples/todo-list$ npm start

@loopback/[email protected] prestart /media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list
npm run build

@loopback/[email protected] build /media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list
lb-tsc

src/controllers/todo-list-todo.controller.ts:75:52 - error TS2345: Argument of type 'typeof Todo' is not assignable to parameter of type 'typeof Model'.

75 @param.query.object('where', getWhereSchemaFor(Todo)) where?: Where,
~~~~

src/controllers/todo-list-todo.controller.ts:90:52 - error TS2345: Argument of type 'typeof Todo' is not assignable to parameter of type 'typeof Model'.

90 @param.query.object('where', getWhereSchemaFor(Todo)) where?: Where,
~~~~

src/controllers/todo-list.controller.ts:53:52 - error TS2345: Argument of type 'typeof TodoList' is not assignable to parameter of type 'typeof Model'.
Types of property 'definition' are incompatible.
Type 'import("/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/repository/dist8/src/model").ModelDefinition' is not assignable to type 'import("/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/boot/node_modules/@loopback/repository/dist8/src/model").ModelDefinition'.

53 @param.query.object('where', getWhereSchemaFor(TodoList)) where?: Where,
~~~~

src/controllers/todo-list.controller.ts:67:54 - error TS2345: Argument of type 'typeof TodoList' is not assignable to parameter of type 'typeof Model'.

67 @param.query.object('filter', getFilterSchemaFor(TodoList)) filter?: Filter,
~~~~

src/controllers/todo-list.controller.ts:82:52 - error TS2345: Argument of type 'typeof TodoList' is not assignable to parameter of type 'typeof Model'.

82 @param.query.object('where', getWhereSchemaFor(TodoList)) where?: Where,
~~~~

src/controllers/todo.controller.ts:63:54 - error TS2345: Argument of type 'typeof Todo' is not assignable to parameter of type 'typeof Model'.
Types of property 'definition' are incompatible.
Type 'import("/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/repository/dist8/src/model").ModelDefinition' is not assignable to type 'import("/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/boot/node_modules/@loopback/repository/dist8/src/model").ModelDefinition'.
Property 'addRelation' is missing in type 'ModelDefinition'.

63 @param.query.object('filter', getFilterSchemaFor(Todo)) filter?: Filter,
~~~~

src/models/todo-list.model.ts:28:12 - error TS2345: Argument of type '() => typeof Todo' is not assignable to parameter of type 'typeof Entity'.
Property 'getIdOf' is missing in type '() => typeof Todo'.

28 @hasMany(() => Todo)
~~

src/models/todo-list.model.ts:28:12
28 @hasMany(() => Todo)
~~
Did you mean to call this expression?

src/repositories/todo-list.repository.ts:24:17 - error TS2339: Property 'getter' does not exist on type '{ (repositoryName: string | Class>): RepositoryDecorator; (model: string | typeof Entity, dataSource: string | DataSource): RepositoryDecorator; }'.

24 @repository.getter(TodoRepository)
~~

src/repositories/todo-list.repository.ts:30:7 - error TS2345: Argument of type 'Getter' is not assignable to parameter of type 'EntityCrudRepository Property 'save' is missing in type 'Getter'.

30 todoRepositoryGetter,
~~~~

test/unit/controllers/todo-list-todo.controller.unit.ts:11:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

11 createStubInstance,
~~~~~~

test/unit/controllers/todo-list-todo.controller.unit.ts:14:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

14 StubbedInstanceWithSinonAccessor,
~~~~~~~~

test/unit/controllers/todo-list.controller.unit.ts:7:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

7 createStubInstance,
~~~~~~

test/unit/controllers/todo-list.controller.unit.ts:10:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

10 StubbedInstanceWithSinonAccessor,
~~~~~~~~

test/unit/controllers/todo.controller.unit.ts:7:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'createStubInstance'.

7 createStubInstance,
~~~~~~

test/unit/controllers/todo.controller.unit.ts:10:3 - error TS2305: Module '"/media/elrond_2tb/devel/thirdparty-use/loopback-next/examples/todo-list/node_modules/@loopback/testlab/index"' has no exported member 'StubbedInstanceWithSinonAccessor'.

10 StubbedInstanceWithSinonAccessor,
~~~~~~~~

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @loopback/[email protected] build: lb-tsc
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @loopback/[email protected] build 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-03T18_50_32_823Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @loopback/[email protected] prestart: npm run build
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @loopback/[email protected] prestart 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-03T18_50_32_845Z-debug.log

[2] =========================================
alain@aegnor:~/devel/strongloop/test-todo-list/loopback4-example-todo-list$ npm start

@loopback/[email protected] prestart /media/elrond_2tb/devel/strongloop/test-todo-list/loopback4-example-todo-list
npm run build

@loopback/[email protected] build /media/elrond_2tb/devel/strongloop/test-todo-list/loopback4-example-todo-list
lb-tsc

@loopback/[email protected] start /media/elrond_2tb/devel/strongloop/test-todo-list/loopback4-example-todo-list
node .

Server is running at http://[::1]:3000

but in the browser (Chrome on Ubuntu) (url: http://[::1]:3000)
NotFoundError
404 Endpoint "GET /" not found.

@marioestradarosa, @b-admike
Hi again Mario,
Regarding "lb4 example" with @loopback/cli v. 0.27, see above.

Thanks for the suggestion and info about new version. I will give it a try shortly (probably in a brand new virtual Ubuntu 18.04 VirtualBox machine, to avoid any possible contamination from the past. I'll let you know.

Kind regards (I'm impressed by the support ;-), really)

With lb4 v. 0.28 at least (previous attempt with 0.27 deleted), the API explorer shows methods related to todo-list. I didn't try the explorer previously. However the published url (http://[::1]:3000) still yields the same 404 error as reported above.

However the published url (http://[::1]:3000) still yields the same 404 error as reported above.

Can you try localhost:3000 instead? , I think that address is for iPV6 ? and probably not supported for your os?

second thought, if you are reading the 404 is because it supports it 馃槃 I reproduced it. however, you can access the todo lists http://[::1]:3000/todo-lists

@marioestradarosa,

Just retried. As you supposed, localhost:3000 yields the same 404 error.

http://[::1]:3000/todo-lists
or
http://[::1]:3000/todo-lists/1/todos
to see childs of todo-lists id 1

the / , should present only a link to the api explorer (which I don't use usually, since I use postman). So, I go directly to the REST end points. like /todo-lists

or go to /explorer

/todo-lists yields a JSON response:
[{"id":1,"title":"Sith lord's check list"},{"id":2,"title":"daily routine of POTUS"}]

and /todo-lists/count also yields:
{"count":2}

So, presumably, everything is fine (except the suggested URL)?

Exactly. The / should have presented an index with lb4 logo an a link to the api explorer. but again, that's not something I use on a regular basis, so found out it is apparently not working, or the Team removed it intentionally.

@b-admike , can you confirm if we should present something in the / ?

Thanks @marioestradarosa for chiming in and helping @koalabi 馃憤. Great discussion, and yes the example todo application doesn't have the home page html/controller that @raymondfeng recently introduced into our templates (I have confirmed that it returns a 404). This might be a good indication that we need it for all of our examples (thoughts @marioestradarosa @raymondfeng @bajtos @strongloop/sq-lb-apex?). @koalabi for now, you can go to the API explorer if you have a browser at http://localhost:3000/explorer and check out the REST API endpoints.

@b-admike , could you please create a task for that? Can make it as an interrupt or stretch goal for Oct, since we intentionally leave some buffer for issues/questions from the community. Thanks.

@b-admike,

Thanks for your help and support ;-)

Thank you @koalabi @marioestradarosa 馃帀. @dhmlau I've created the ticket (#1806), let me know what labels you'd like to go on there or feel free to do it :).

Was this page helpful?
0 / 5 - 0 ratings