Hello,
I am developed a macro that is using a custom config. On development it works fine, but at staging not. The is this error:
Error: update(): The given ADFEntity cannot be inserted in the current position.
Error: extension: 'attrs' validation failed.
at fe.error (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:74679)
at Object.<anonymous> (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:82452)
at JSON.parse (<anonymous>)
at Ee.o (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:82311)
at Ee (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:82464)
at We.i.on (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:87124)
at We (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:87261)
at https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:93247
at e.try (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:65731)
at https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:2:93044
I don’t understand the error at all, I am don’t using ADF actively. For submitting configuration I am using this hook:
export const useSubmit = () => {
const [error, setError] = useState();
const [message, setMessage] = useState('');
const submit = async (fields) => {
const payload = {
config: fields
};
try {
await view.submit(payload);
setError(false);
setMessage(`Submitted successfully.`);
} catch (error) {
setError(true);
setMessage(`${error.code}: ${error.message}`);
console.error("Cannot save macro config: ", error, fields);
}
};
return {
error,
message,
submit
};
};
One interesting thing is, that the first submit works fine. If I change the configuration I get the error.
As I mentioned before, I don’t have any idea what is the reason for this error, because it works fine in development but not in staging.
Any help where perfect
Best
Thorsten