Troubleshooting¶
This section covers common errors you may encounter when using dioxide and how to resolve them.
Tip
dioxide is designed to fail fast - errors are caught at startup, not at runtime. This means you’ll see these errors during development, not in production.
Common Errors¶
Quick Diagnosis¶
Use this table to quickly identify your error:
Error Message |
Likely Cause |
|---|---|
“No adapter for X in profile ‘Y’” |
Missing |
“Cannot resolve X in profile ‘Y’” |
Missing |
“Circular dependency detected” |
Two or more |
“REQUEST-scoped, requires active scope” |
Resolving REQUEST component without |
“Captive dependency: X (SINGLETON) -> Y (REQUEST)” |
SINGLETON depending on shorter-lived REQUEST component |
General Troubleshooting Steps¶
Check your decorators
Services need
@serviceAdapters need
@adapter.for_(Port, profile=...)Lifecycle components need
@lifecycle
Check your profile
Verify
Container(profile=...)matches your adapter profilesUse
Profile.ALLfor universal adapters
Check import order
Decorators execute at import time
Ensure modules are imported before container scans
Check type hints
Constructor parameters must have type hints
Type hints must reference registered types
Use explicit package scanning
container = Container(profile=Profile.PRODUCTION) container.scan(package="myapp.adapters")
Getting Help¶
If you’re still stuck:
Check the GitHub Issues for similar problems
Open a new issue with:
The full error message
Minimal code to reproduce
Your dioxide version (
pip show dioxide)