OrchardCMS/OrchardCore · error · Error

msg

Error message

msg

What it means

jQuery.error in the slim build: it throws new Error(msg). All internal error reporting in jquery.slim.js routes through this single throw site, so any invalid usage surfaced by jQuery internals appears here with a descriptive msg.

Solutions

  1. Use the msg and stack to locate the invalid call
  2. Fix the argument (selector, data type, options) at the call site
  3. Replace $.error calls with explicit throw in your own code
  4. Upgrade from jQuery 3.4.1 slim to a maintained 3.7.x build

Example fix

// before
$.error('unsupported operation');
// after
throw new Error('unsupported operation');
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try { $(sel).trigger('x'); } catch (e) { if (e instanceof Error) { console.error('slim jQuery error:', e.message); } }

Prevention

When it happens

Trigger: $.error('...') called directly by app/plugin code; internal slim-jQuery validation failures (bad selectors, malformed arguments) that delegate to jQuery.error.

Common situations: Plugins misusing jQuery APIs; invalid selector or option values passed at runtime; debugging stack traces that end at this throw site.

Understand the failure class

Background: "must be a positive integer", "cannot be empty", "invalid argument": how invalid-argument errors work across open-source libraries — this error's family across 33 libraries.

Related errors


AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13). Data as JSON: /api/errors/7448aa5a17138262. Report an issue: GitHub.

Appendix: source

Thrown at src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/jquery-3.4.1/jquery.slim.js:321

				}
			}
		}
	}

	// 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)