Skip to content

Fails to resolve dependencies with Vite #240

@leo1553

Description

@leo1553

Describe the bug

When trying to resolve a token with one or more dependencies, the error TypeInfo not known for "Bar" is thrown.

To Reproduce

Reproduced on StackBlitz

Sample code:

import '@abraham/reflection';

import { container, singleton } from 'tsyringe';

@singleton()
export class Foo {
  constructor() {}
}

@singleton()
export class Bar {
  constructor(public foo: Foo) {}
}

console.log(container.resolve(Foo)); // Works
console.log(container.resolve(Bar)); // Throws Uncaught Error: TypeInfo not known for "Bar"

Tested with:

{
  "scripts": {
    "start": "vite",
    "build": "tsc && vite build"
  }
}

Expected behavior

The token Bar should have been successfully resolved with its Foo dependency set.

Versions

{
  "devDependencies": {
    "typescript": "^4.9.5",
    "vite": "^5.2.9"
  },
  "dependencies": {
    "@abraham/reflection": "^0.12.0",
    "tsyringe": "^4.8.0"
  }
}

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions