OrchardCMS/OrchardCore · error · Error
msg
Error message
msg
What it means
jQuery 3.6.0's $.error helper throws a new Error with whatever message is passed — the same generic throw site as 3.5.1 (line shifted to 338 in this build). It is not a distinct failure mode; it reports errors on behalf of other jQuery code paths.
Solutions
- Inspect e.message and the next stack frames to identify the jQuery API call that invoked $.error, and fix its inputs.
- Wrap the implicated call in try/catch to capture and report the error context.
- Check the 3.6.0 upgrade guide / breaking changes if the same call worked on 3.5.1, and adjust usage or pin the previous version temporarily.
Example fix
// before
$('#target').append(userHtml); // failure reported via $.error
// after
try {
$('#target').append(userHtml);
} catch (e) {
console.error('jQuery 3.6 call failed:', e.message);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!isNonEmptyString(arg)) throw new Error('Refusing jQuery call with empty input');
function isNonEmptyString(v) { return typeof v === 'string' && v.length > 0; } Type guard
function isSafeHtmlString(v) { return typeof v === 'string' && !/\<\s*script/i.test(v); } Try / catch
try { $('#el').call(input); } catch (e) { captureError(e, { context: 'jquery-3.6.0 $.error', message: e.message }); } Prevention
- Always capture e.message and full stack; $.error only formats the message.
- After a 3.6.0 upgrade, compare e.message against 3.5.1 behavior for changed validation.
- Sanitize inputs before HTML/selector APIs.
- Keep error reporting configured to store complete Error objects.
When it happens
Trigger: Internal jQuery 3.6.0 paths calling $.error(message) upon invalid input — e.g. bad markup in html(), invalid method arguments, or failures surfaced through deferred chains.
Common situations: Stack traces whose top frame is this helper after upgrading to 3.6.0; the real cause is in e.message and the caller frames below.
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
- msg
- msg
- jQuery requires a window with a document
- msg
- nestedSortable: Please check that the listType option is…
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/b8d3445f347ef35b.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/jquery-3.6.0/jquery.js:338
}
}
}
}
// 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)