We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Error: Cannot read property 'match' of undefined: Error during instantiation of AgendaService! (Server -> AgendaService).
wrappedError injectionError instantiationError ReflectiveInjector_._instantiate
Enviroment: injection-js: ~2.2.1 npm: 5.5.1 node: 9.2.0 typescript: ~2.5.3
The text was updated successfully, but these errors were encountered:
import 'reflect-metadata'; import {Injectable, ReflectiveInjector} from "injection-js"; import {AgendaService} from "./app/service/agenda.service"; @Injectable() class Server { constructor(private agendaService: AgendaService) { } } const injector = ReflectiveInjector.resolveAndCreate([ AgendaService ]); const server: Server = injector.get(Server);
Sorry, something went wrong.
// etc @Injectable() export class AgendaService { constructor(){ this._agenda = new Agenda(); // edit: the ausent SOME_VAR causes the error this._agenda.database(process.env.SOME_VAR); } //etc
it's caused by an ausent enviroment variable
process.env.SOME_VAR
if it does not exists throws this error:
Cannot read property 'match' of undefined
Adding enviroment var, fixes the problem.
issue updated.
No branches or pull requests
Uncaught Error: Cannot read property 'match' of undefined: Error during instantiation of AgendaService! (Server -> AgendaService).
wrappedError
injectionError
instantiationError
ReflectiveInjector_._instantiate
Enviroment:
injection-js: ~2.2.1
npm: 5.5.1
node: 9.2.0
typescript: ~2.5.3
The text was updated successfully, but these errors were encountered: