bettercap/bettercap · error · Error
A platform with a different configuration has been created.
Error message
A platform with a different configuration has been created. Please destroy it first.
What it means
assertPlatform verifies the existing platform provides the required marker token for the requested platform type (e.g. browser vs server). This throw fires when a platform exists but was created from a different factory/configuration, so it cannot satisfy the token the caller expects.
Source
Thrown at modules/ui/ui/vendor.js:57791
var injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true });
createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
}
}
return assertPlatform(marker);
};
}
/**
* Checks that there currently is a platform which contains the given token as a provider.
*
* @publicApi
*/
function assertPlatform(requiredToken) {
var platform = getPlatform();
if (!platform) {
throw new Error('No platform exists!');
}
if (!platform.injector.get(requiredToken, null)) {
throw new Error('A platform with a different configuration has been created. Please destroy it first.');
}
return platform;
}
/**
* Destroy the existing platform.
*
* @publicApi
*/
function destroyPlatform() {
if (_platform && !_platform.destroyed) {
_platform.destroy();
}
}
/**
* Returns the current platform.
*
* @publicApi
*/View on GitHub (pinned to 8eca2820f3)
Solutions
- Use a single, consistent platform factory (e.g. platformBrowser) across the app
- Destroy the mismatched platform before initializing the required one
- Check for double bootstrap from different Angular platform packages (browser/server/hybrid)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/ui/ui/vendor.js:57791 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of bettercap/bettercap@8eca2820f3 (2026-09-02).
Data as JSON: /api/errors/2be9a5801d68f323.
Report an issue: GitHub.