question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeInfo not known for function Bar(foo)

See original GitHub issue

I created a react app with --typescript install tsyringe and reflect-metadata and got this error

Uncaught TypeInfo not known for function Bar(foo)
import {container, injectable} from "tsyringe"

export class Foo {}

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

export const myBar = container.resolve(Bar);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

35reactions
perf2711commented, Aug 20, 2019

If you stumble upon this issue outside of React, be sure that the service you’re resolving has a @injectable() decorator.

8reactions
Xapphire13commented, Apr 4, 2019

Do you have the following in your tsconfig.json?

"compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is Foo not a function when I defined it? - Stack Overflow
Hopefully, this makes it obvious why 'foo is not a function'. Your bar function is declaring a new foo variable (which hides the...
Read more >
test/e2e/sources/debugger-language-plugins_test.ts - devtools ...
extensionAPI: unknown, pluginImpl: TestPluginImpl, name: string, ... startsWith('[Formatter Errors]')), ['Uncaught No typeinfo for bar']);.
Read more >
std::bad_cast - cppreference.com
An exception of this type is thrown when a dynamic_cast to a reference type fails the run-time check (e.g. because the types are...
Read more >
COMPUTER SCIENCE I & II
Implicit init not allowed for constructor without args: A foo(); //error: declares a function foo. A foo; A bar = A(); //ok.
Read more >
ctz - Documentation - The Zig Programming Language
In this case, the function bar cannot be called becuse the pointer to the non-ABI-aligned field mentions the bit offset, but the function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found