yikart/AiToEarn · error · AppException
ResponseCode.ChannelAccountCreateNotSupported
ResponseCode.ChannelAccountCreateNotSupported
Error message
ChannelAccountCreateNotSupported
What it means
WeChatChannels account creation depends on an injected wechatService used to exchange loginCookie for auth data. If this.wechatService is not available (module not configured/registered in the current deployment), the service throws ChannelAccountCreateNotSupported — WeChat Channels connections are not supported in this environment.
Source
Thrown at project/aitoearn-backend/apps/aitoearn-server/src/core/channels/accounts/account.service.ts:493
const normalizedData: NormalizedAccountCreateInput = {
...data,
uid: data.uid,
nickname: data.nickname,
}
if (normalizedData.type === AccountType.RedNote && normalizedData.clientType === undefined) {
normalizedData.clientType = ClientType.WEB
}
return normalizedData
}
private async normalizeWeChatChannelsCreateInput(data: AccountCreateInput): Promise<NormalizedAccountCreateInput> {
if (!data.loginCookie) {
throw new AppException(ResponseCode.ChannelAccountCreateRequiredFieldMissing, {
fields: ['loginCookie'],
})
}
if (!this.wechatService) {
throw new AppException(ResponseCode.ChannelAccountCreateNotSupported)
}
const authData = await this.wechatService.getChannelsAuthData(data.loginCookie)
if (!authData.uid) {
throw new AppException(ResponseCode.ChannelPlatformResponseInvalid)
}
if (data.uid && data.uid !== authData.uid) {
throw new AppException(ResponseCode.ChannelPlatformResponseInvalid)
}
const normalizedData = { ...data }
delete normalizedData.uid
delete normalizedData.account
delete (normalizedData as Record<string, unknown>)['channelId']
return {
...normalizedData,
uid: authData.uid,View on GitHub (pinned to d3aa8bea5b)
Solutions
- Enable/register the WeChat service module for this deployment (check module wiring and env flags).
- Verify you are using the correct environment edition (China vs international) that supports WeChat Channels.
- If unsupported by design, use an alternative connection method or a different environment where WeChatChannels is supported.
- Confirm DI registration so this.wechatService is injected rather than undefined.
Example fix
// before // module without WeChat provider imported imports: [ChannelsModule] // after imports: [ChannelsModule, WechatServiceModule] // ensures wechatService is injected
Defensive patterns
Strategy: fallback
Validate before calling
// Check support before offering the flow
const wechatSupported = typeof wechatService !== 'undefined'
if (data.type === AccountType.WeChatChannels && !wechatSupported) {
useAlternativeConnectionFlow(data) // or route to a supported environment
} Type guard
function wechatChannelsSupported(env): boolean {
return env.features?.wechatChannels === true
} Try / catch
try {
await createAccount(data)
} catch (e) {
if (e instanceof AppException && e.code === ResponseCode.ChannelAccountCreateNotSupported) {
// inform user WeChat Channels is unavailable in this environment; offer alternative
} else throw e
} Prevention
- Gate the WeChatChannels option in the UI by environment/feature flags.
- Ensure the WeChat service module is registered where the feature is offered.
- Verify China vs international edition support before exposing the flow.
- Surface a clear 'not supported here' message instead of letting users hit the API.
When it happens
Trigger: Creating a WeChatChannels account with a valid loginCookie in a deployment where the WeChat service module is absent or conditionally not registered (e.g. an edition/build without the WeChat integration enabled).
Common situations: Deploying without the WeChat service provider configured/enabled; feature flag or env var gating the WeChat module off; calling WeChatChannels creation against an environment that intentionally disables it.
Related errors
- InvalidModel
- InvalidModel
- image aspectRatio cannot be converted to a supported size
- ChannelAuthorizationFailed
- PlatformNotSupported
AI-assisted analysis of yikart/AiToEarn@d3aa8bea5b (2026-08-31).
Data as JSON: /api/errors/9725c0802d452f6b.
Report an issue: GitHub.