OrchardCMS/OrchardCore · error · Error
msg
Error message
msg
What it means
The slim build's jQuery.error helper throws a new Error with the given message — same generic failure mechanism as the full build. This line is merely the throw site; the meaningful information is the message string and the jQuery API that invoked $.error in the stack below this frame.
Solutions
- Read e.message and the following stack frames to find which jQuery call raised the error; correct the arguments there.
- Wrap the suspicious jQuery call in try/catch to capture and log the message for diagnosis.
- If the failure appeared after switching to the slim build, remember ajax/effects APIs are absent — calling removed/undefined helpers can cascade into $.error paths; use the full build or adjust code.
Example fix
// before
$('#box').html(template); // error surfaces via $.error
// after
try {
$('#box').html(template);
} catch (e) {
console.error('jQuery (slim) failed:', e.message);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!isNonEmptyString(input)) throw new Error('Invalid input before jQuery call');
function isNonEmptyString(v) { return typeof v === 'string' && v.length > 0; } Type guard
function isStringOrNode(v) { return typeof v === 'string' || (v && v.nodeType === 1); } Try / catch
try { $('#x').html(markup); } catch (e) { logError('jQuery slim $.error:', e.message, e.stack); } Prevention
- Trace past the $.error frame; the caller frame holds the real cause.
- Validate markup/selector strings before passing them to jQuery.
- If migrating from full to slim build, audit removed ajax/effects usage.
- Capture full stack traces in error reporting to avoid dead-end debugging.
When it happens
Trigger: Any jQuery (slim) internal path that detects invalid input and calls $.error(message): malformed markup passed to html(), unsupported arguments, or propagated failures inside deferred chains.
Common situations: Debugging a stack whose top frame is this $.error helper; the actual bad call site is the next stack frame, and the specific reason is in e.message.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/6c64843057775af8.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/jquery-3.5.1/jquery.slim.js:334
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend( {
// Unique for each copy of jQuery on the page
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
// Assume jQuery is ready without the ready module
isReady: true,
error: function( msg ) {
throw new Error( msg );
},
noop: function() {},
isPlainObject: function( obj ) {
var proto, Ctor;
// Detect obvious negatives
// Use toString instead of jQuery.type to catch host objects
if ( !obj || toString.call( obj ) !== "[object Object]" ) {
return false;
}
proto = getProto( obj );
// Objects with no prototype (e.g., `Object.create( null )`) are plain
if ( !proto ) {
return true;View on GitHub (pinned to 4306c0717f)