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.

Error injecting interfaces

See original GitHub issue

Describe the bug not inject interface

To Reproduce container.register<ITestSubService>(injection_types.ITestSubService, TestSubService);

@injectable()
class LocalStorageService implements ILocalStorageService
{
    constructor(private test : ITestSubService)
    { 
    }
}

console - Uncaught Error: Cannot inject the dependency at position #0 of “LocalStorageService” constructor. Reason: TypeInfo not known for “Object” at eval (dependency-container.js?013a:244) at Array.map (<anonymous>) at InternalDependencyContainer.construct (dependency-container.js?013a:229) at InternalDependencyContainer.resolveRegistration (dependency-container.js?013a:108) at InternalDependencyContainer.resolve (dependency-container.js?013a:79) at setup (App.vue?3acc:25) at callWithErrorHandling (runtime-core.esm-bundler.js?5c40:154) at setupStatefulComponent (runtime-core.esm-bundler.js?5c40:6224) at setupComponent (runtime-core.esm-bundler.js?5c40:6185) at mountComponent (runtime-core.esm-bundler.js?5c40:3960) Expected behavior if change ITestSubService to implementation - TestSubService all works fine

Version: 4.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
MeltingMosaiccommented, Nov 9, 2020

Hmm, strangely, it looks like it thinks that injection_types is undefined. If you test it just using raw strings rather than symbols at both registration and injection time does it work?

0reactions
ghostcommented, Nov 21, 2020

… I just found where i got error If import container after import App, i got error.

import "reflect-metadata";

import { createApp } from 'vue';

import App from './App.vue';
import { services } from './injection/injection.config';
import './registerServiceWorker'

import router from './router'
  • error
import "reflect-metadata";

import { createApp } from 'vue';
import { services } from './injection/injection.config';
import App from './App.vue';

import './registerServiceWorker'

import router from './router'
  • no error…

MeltingMosaic thank you very much for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Injection Interface - 4.1 English
The Error Injection Interface is present when controllers support error injection and the HID shim is set to I/O Pins.
Read more >
c# - A problem implementing Dependency Injection and ...
I'm trying to get an idea of dependency injection and interfaces but I'm running into a weird problem. https://dotnetfiddle.net/5vfcd0. I have ...
Read more >
error injecting interface on DevNet
Hi there,Injecting interfaces service to custom schedule task gives me error @Additional assemblies have to be registered before application ...
Read more >
AoT error with `@Inject` and interface type · Issue #12631
In this case it shouldn't. In general, if no @Inject() is provided, the type of the argument is the type of the instance...
Read more >
18.6. Error Injection — ACPI Specification 6.4 documentation
The Error Injection (EINJ) table provides a generic interface mechanism through which OSPM can inject hardware errors to the platform without requiring platform...
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