Skip to content

INVERSITY-EXPRESS-EXAMPLE cannot run BindingDecorators #1406

@wasdueyesterday

Description

@wasdueyesterday

Expected Behavior

I'm studying INVERSIFY-EXPRESS-EXAMPLE.

According to README, I can start the service with the command ts-node BindingDecorators/bootstrap.ts.

Current Behavior

However, when I run it, i got the error "No matching bindings found for serviceIdentifier: Symbol(UserService)".

Possible Solution

This link discusses a similar issue and the answer points out the general solution to the error

However, I need some help to determine where the problem is. Is it the example or the lib? Most likely it's the example and the unit test is not catching the error? It's also possible that the problem is mine as I'm very new to type script and inversify.

Steps to Reproduce (for bugs)

  1. Sync down the code from INVERSIFY-EXPRESS-EXAMPLE
  2. Follow README and run ts-node BindingDecorators/bootstrap.ts after running command ahead of this
  3. Encounter error Error: No matching bindings found for serviceIdentifier: Symbol(UserService)

Context

I'm studying the example to learn the module

Your Environment

  • Version used:
    See package.json
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
    node: v14.18.2
    tsc: 4.5.2
  • Operating System and version (desktop or mobile):
    mac os 11.4
    vscode latest
  • Link to your project:
    The project is INVERSIFY-EXPRESS-EXAMPLE

Stack trace

Error: No matching bindings found for serviceIdentifier: Symbol(UserService) at _validateActiveBindingCount (/inversify-express-example/node_modules/inversify/src/planning/planner.ts:113:23) at _getActiveBindings (/inversify-express-example/node_modules/inversify/src/planning/planner.ts:91:5) at _createSubRequests (/inversify-express-example/node_modules/inversify/src/planning/planner.ts:163:26) at /inversify-express-example/node_modules/inversify/src/planning/planner.ts:197:17 at Array.forEach () at inversify-express-example/node_modules/inversify/src/planning/planner.ts:196:26 at Array.forEach () at _createSubRequests (inversify-express-example/node_modules/inversify/src/planning/planner.ts:167:20) at Object.plan (/inversify-express-example/node_modules/inversify/src/planning/planner.ts:243:9) at /inversify-express-example/node_modules/inversify/src/container/container.ts:367:27

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions