n8n-io/n8n · error · NodeOperationError
The resource "${resource}" is not supported!
Error message
The resource "${resource}" is not supported! What it means
Default branch of the Moonshot router switch on the resource parameter. Supported values are image and text; any other value falls through to this throw. As with the MiniMax router, the UI enum normally prevents this, but hand-edited workflow JSON, stale node definitions, or renamed resources can reach it.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/vendors/Moonshot/actions/router.ts:28
const items = this.getInputData();
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
const moonshotTypeData = {
resource,
operation,
} as MoonshotType;
let execute;
switch (moonshotTypeData.resource) {
case 'image':
execute = image[moonshotTypeData.operation].execute;
break;
case 'text':
execute = text[moonshotTypeData.operation].execute;
break;
default:
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`);
}
for (let i = 0; i < items.length; i++) {
try {
const responseData = await execute.call(this, i);
returnData.push(...responseData);
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
continue;
}
throw new NodeOperationError(this.getNode(), error, {
itemIndex: i,
description: error.description,
});
}
}View on GitHub (pinned to 5ac6606e81)
Solutions
- Open the node in the n8n UI and re-select the resource from the dropdown.
- Inspect the workflow JSON's resource field and set it to 'image' or 'text'.
- Update the Moonshot node to the latest version so router and enum agree.
- After importing a workflow, remap the resource field to the current enum.
Defensive patterns
Strategy: validation
Validate before calling
const MOONSHOT_RESOURCES = ['image', 'text'] as const;
type MoonshotResource = typeof MOONSHOT_RESOURCES[number];
function isValidMoonshotResource(r: unknown): r is MoonshotResource {
return typeof r === 'string' && (MOONSHOT_RESOURCES as readonly string[]).includes(r);
}
const resource = this.getNodeParameter('resource', 0) as unknown;
if (!isValidMoonshotResource(resource)) {
throw new NodeOperationError(
this.getNode(),
`Resource '${String(resource)}' is invalid. Supported: ${MOONSHOT_RESOURCES.join(', ')}.`,
);
} Type guard
function isMoonshotResource(r: unknown): r is 'image' | 'text' {
return r === 'image' || r === 'text';
} Try / catch
// This is a programming/data error, not a transient one — do not retry. // Validate up front (see validationCode) so the user gets a clear message.
Prevention
- Select resource from the node UI dropdown rather than editing JSON by hand.
- After importing a workflow, re-select each Moonshot node's resource to reset it to a valid enum value.
- Keep the Moonshot node updated so the UI enum and router switch stay in sync.
- If forking the node, add new resources to both the parameter enum and the router switch in the same commit.
When it happens
Trigger: Workflow JSON has resource set to a value not in {image, text}; node definition and router shipped out of sync; corrupted/migrated workflow with a legacy or localized resource string; programmatic workflow injection with an invalid resource.
Common situations: Direct JSON editing; imported workflow from a different n8n version with renamed resources; localization leaked into the parameter; community fork renamed resources.
Related errors
- The resource "${resource}" is not supported!
- The resource "${resource}" is not supported!
- The operation "${operation}" is not supported!
- ${error.message}
- The operation "${operation}" is not supported!
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/be088eff84c51372.
Report an issue: GitHub.