RocketChat/Rocket.Chat · error · Error
error-evaluating-script
Error message
error-evaluating-script
What it means
The isolated-vm-backed script evaluator failed while compiling/evaluating the integration script — a syntax error or vm-level failure at load time, before any method can run. The detailed cause is logged as 'Error evaluating integration script' (with the full script) and then rethrown as this generic error.
Source
Thrown at apps/meteor/server/lib/integrations/lib/isolated-vm/isolated-vm.ts:96
}),
) as Partial<IScriptClass>;
this.compiledScripts[integration._id] = {
script: scriptFunctions,
store: {},
_updatedAt: integration._updatedAt,
};
return scriptFunctions;
} catch (err: any) {
this.logger.error({
msg: 'Error evaluating integration script',
integration: integration.name,
script,
err,
});
throw new Error('error-evaluating-script');
}
}
}
View on GitHub (pinned to b2c16d5842)
Solutions
- Check logs for 'Error evaluating integration script' — it includes the script and the underlying error
- Run the script through `node --check` (or an editor's JS linter) to find the syntax error, fix, and re-save
- Stick to ES syntax supported by the platform's isolated-vm/Node version
Example fix
// before: pasting an unverified script into the integration editor
// (unbalanced brace)
module.exports = {
processOutgoingRequest({ request }) {
return { response: { headers: { 'content-type': 'application/json' } } };
}
// after: verify syntax locally before pasting
// $ node --check integration-script.js
module.exports = {
processOutgoingRequest({ request }) {
return { response: { headers: { 'content-type': 'application/json' } } };
},
}; Defensive patterns
Strategy: validation
Validate before calling
// cheap syntax pre-check before enabling the integration's script
try {
new Function(script);
} catch {
// syntax error: block saving/enabling and show it to the author
} Try / catch
try {
await integrationScriptEngine.evaluate(integration);
} catch (err) {
if (err instanceof Error && err.message === 'error-evaluating-script') {
// compile-time failure: fix the script syntax; logs hold the exact error
return;
}
throw err;
} Prevention
- Run `node --check` (or an editor linter) on integration scripts before pasting them in
- Limit scripts to ES syntax supported by the platform's isolated-vm/Node runtime
- Watch the 'Error evaluating integration script' log entry — it includes the full failing script
When it happens
Trigger: Saving/enabling an integration whose script contains a syntax error, uses syntax unsupported by the platform's isolated-vm/Node version, or fails during sandbox setup — distinct from error-running-script, which is a script that compiles but throws at runtime.
Common situations: Pasted scripts with typos or unbalanced braces; scripts using too-new ECMAScript syntax for the bundled runtime; truncated script content from copy/paste.
Related errors
- error-running-script
- integration-scripts-unknown-engine
- integration-scripts-isolated-vm-disabled
- The integration does not exists.
- not-authorized
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/967d5fde885c1726.
Report an issue: GitHub.