nocobase/nocobase · error · FlowSurfaceBadRequestError
${label} does not support: ${unknownKeys.join(', ')}
Error message
${label} does not support: ${unknownKeys.join(', ')} What it means
assertAllowedKeys performs strict key checking on normalized chart config objects: any key not present in the allowed Set causes FlowSurfaceBadRequestError listing the unsupported keys. This blocks unknown/legacy fields from entering chart config.
Source
Thrown at packages/plugins/@nocobase/plugin-flow-engine/src/server/flow-surfaces/chart-config.ts:579
return direction.toUpperCase();
}
function fromPersistedOrder(input: any) {
if (_.isUndefined(input) || _.isNull(input) || String(input).trim() === '') {
return undefined;
}
const normalized = String(input).trim().toLowerCase();
return CHART_SORT_DIRECTION_SET.has(normalized) ? normalized : undefined;
}
function createEmptyFilterGroup() {
return _.cloneDeep(FLOW_SURFACE_EMPTY_FILTER_GROUP);
}
function assertAllowedKeys(input: Record<string, any>, allowed: Set<string>, label: string) {
const unknownKeys = Object.keys(input).filter((key) => !allowed.has(key));
if (unknownKeys.length) {
throw new FlowSurfaceBadRequestError(`${label} does not support: ${unknownKeys.join(', ')}`);
}
}
function mergeReplaceArrays(base: any, patch: any) {
return _.mergeWith({}, _.cloneDeep(base || {}), _.cloneDeep(patch || {}), (_objValue, srcValue) => {
if (Array.isArray(srcValue)) {
return srcValue;
}
return undefined;
});
}
function normalizeChartResourceFromCollectionPath(
collectionPath: any,
label: string,
options: { required?: boolean } = {},
) {
if (_.isUndefined(collectionPath) || _.isNull(collectionPath)) {View on GitHub (pinned to fa42722fef)
Solutions
- Remove the unsupported keys listed in the message before submitting
- Check the current chart-config schema for the correct key names (typos are the usual cause)
- Migrate deprecated keys to their current equivalents per the plugin's current version
Example fix
// before
basicVisual: { type: 'bar', colorScheme: 'default' } // colorScheme not supported
// after
basicVisual: { type: 'bar' } Defensive patterns
Strategy: validation
Validate before calling
function pickAllowed(obj, allowedKeys) {
return Object.fromEntries(Object.entries(obj).filter(([k]) => allowedKeys.includes(k)));
}
const payload = pickAllowed(basicVisual, ['type', 'title', 'legend', 'axes']); Type guard
function hasOnlyKeys<T extends object>(obj: T, allowed: readonly (keyof T)[]): boolean {
return Object.keys(obj).every((k) => (allowed as string[]).includes(k));
} Try / catch
try {
await api.saveChartConfig(config);
} catch (err) {
if (err instanceof FlowSurfaceBadRequestError && err.message.includes('does not support')) {
const bad = err.message.split(': ')[1]?.split(', ') ?? [];
bad.forEach((k) => delete config.basicVisual[k]);
}
throw err;
} Prevention
- Strip metadata keys (id, createdAt, UI-only state) from payloads before submit
- Keep client config types in sync with the plugin version after upgrades
- Whitelist-and-forward rather than forwarding whole form state
When it happens
Trigger: Submitting chart config objects containing extra properties (typo'd keys, deprecated fields, nested wrapper objects) to the chart config normalizers, e.g. normalizeBasicVisual with an unexpected key in the visual block.
Common situations: Configs copied from older plugin versions whose schema changed; hand-written JSON with typos ('lable' instead of 'label'); clients that forward whole form state including helper keys like 'id' or 'createdAt'.
Related errors
- ${label} must be a string or string[]
- ${label} cannot contain empty path segments
- ${label} is invalid: ${input}
- ${label} must be a string[]
- chart query.resource and chart query.collectionPath must ref
AI-assisted analysis of nocobase/nocobase@fa42722fef (2026-09-01).
Data as JSON: /api/errors/764d4f5efdfd773d.
Report an issue: GitHub.