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.

DIContainer could not get service: No arguments were given!

See original GitHub issue

I’m getting error

DIContainer could not get service: No arguments were given!
when register service

container.registerSingleton<ORMAdapter, PrismaAdapter>();

In source code there is

if (options == null) throw new ReferenceError(${this.constructor.name} could not get service: No arguments were given!);

But I can’t found info about required options argument.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
godrosecommented, Apr 7, 2022

@cmidgley must be something with the dev machine. Thanks!

0reactions
wessbergcommented, Apr 7, 2022

Hi there. @cmidgley, thanks for your excellent help here. @olegKusov, please refer to the suggestions by @cmidgley here, as well as the documentation for setting up DI-compiler.

I’m going to close this issue, but feel free to reach out again if you have any additional problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swinject/DIContainer.md at master - GitHub
Registration with Arguments in a DI Container. The factory closure passed to the register method can take arguments that are passed when the...
Read more >
ASP.NET Core Dependency Injection with Multiple Constructors
InvalidOperationException: Multiple constructors accepting all given argument types have been found in type 'MyNameSpace.MyTagHelper'. There should only be one ...
Read more >
Dependency injection guidelines - .NET | Microsoft Learn
Learn various dependency injection guidelines and best practices for .NET application development.
Read more >
Activator utilities: activate anything! - On The Drift
Examples given in this post are available on Github ... the DI container would not be able to know anything about the lifetime...
Read more >
Services and dependency injection in Drupal 8+
The best practice for these is not to call out to the global service container and instead pass in the required services as...
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