symfony/translation · error · UnsupportedSchemeException
The scheme is not supported by any provider.
Error message
The scheme is not supported by any provider.
What it means
Thrown by TranslationProviderCollectionFactory::fromDsnObject() when no registered provider factory supports the Dsn's scheme. It produces UnsupportedSchemeException with a default message indicating the scheme is not supported by any provider.
Solutions
- Install the matching provider package: composer require symfony/<provider>-translation-provider
- Check the DSN scheme spelling in TRANSLATION_PROVIDER_DSN
- List supported schemes via each factory's getSupportedSchemes() to confirm
Example fix
// before TRANSLATION_PROVIDER_DSN=loco://default # loco provider not installed // after composer require symfony/loco-translation-provider TRANSLATION_PROVIDER_DSN=loco://API_KEY@default
Defensive patterns
Strategy: validation
Validate before calling
$supported = array_merge(...array_map(fn($f) => $f->getSupportedSchemes(), $factories));
if (!in_array($dsn->getScheme(), $supported, true)) {
throw new \InvalidArgumentException("Scheme {$dsn->getScheme()} unsupported; install the provider package.");
} Try / catch
try {
$collection = $factory->fromConfig($config, $locales, $domains);
} catch (UnsupportedSchemeException $e) {
// report that the DSN scheme has no installed provider factory
} Prevention
- composer require the symfony/<provider>-translation-provider package for each DSN you use
- Keep TRANSLATION_PROVIDER_DSN schemes lowercase and exact
- Smoke-test provider DSNs in CI before deploy
When it happens
Trigger: Calling fromDsnObject/fromConfig with a DSN whose scheme no factory's supports() accepts — e.g. an unknown or misspelled scheme, or a factory package not installed.
Common situations: Using a provider package that is not composer-installed (e.g. symfony/loco-translation-provider missing), typo in DSN scheme, or a DSN scheme like 'http://' that no translation provider supports.
Related errors
- Missing required option
- The scheme "null" is not supported by this provider.
- Provider " " not found. Available: " ".
- The " ()" method cannot be called as the wrapped translator…
- No loader is registered for the
AI-assisted analysis of symfony/translation@ae9e8a51bc (2026-09-15).
Data as JSON: /api/errors/7e26f29e2d85a451.
Report an issue: GitHub.
Appendix: source
Thrown at Provider/TranslationProviderCollectionFactory.php:52
$providers[$name] = $this->fromDsnObject(
new Dsn($currentConfig['dsn']),
!$currentConfig['locales'] ? $this->enabledLocales : $currentConfig['locales'],
!$currentConfig['domains'] ? [] : $currentConfig['domains']
);
}
return new TranslationProviderCollection($providers);
}
public function fromDsnObject(Dsn $dsn, array $locales, array $domains = []): ProviderInterface
{
foreach ($this->factories as $factory) {
if ($factory->supports($dsn)) {
return new FilteringProvider($factory->create($dsn), $locales, $domains);
}
}
throw new UnsupportedSchemeException($dsn);
}
}
View on GitHub (pinned to ae9e8a51bc)