OrchardCMS/OrchardCore · error · Error

The ' ' argument is required.

Error message

The '${name}' argument is required.

What it means

The SignalR client's Arg.isRequired static helper throws when a required argument is null or undefined. This is an internal argument-validation guard used throughout @microsoft/signalr constructors and methods.

Solutions

  1. Ensure the connection URL / options object is defined before building the connection
  2. Log or validate arguments before calling SignalR APIs
  3. Fix config loading order so the URL resolves first

Example fix

// before
const conn = new signalR.HubConnectionBuilder().withUrl(hubUrl).build(); // hubUrl undefined
// after
if (!hubUrl) throw new Error('hubUrl missing'); const conn = new signalR.HubConnectionBuilder().withUrl(hubUrl).build();
Defensive patterns

Strategy: validation

Validate before calling

if (url == null || url === undefined) throw new Error('connection URL must be set before building the hub connection');

Type guard

const isDefined = (v) => v !== null && v !== undefined;

Try / catch

try { conn = new signalR.HubConnectionBuilder().withUrl(url).build(); } catch (e) { if (e.message.includes("argument is required")) { console.error('Missing required SignalR argument:', e.message); } }

Prevention

When it happens

Trigger: Calling a SignalR API (e.g. new HubConnectionBuilder(), withUrl(url), HubConnection constructor) passing null/undefined for a required parameter such as the URL, IHttpConnectionOptions, or a delegate.

Common situations: Config value not loaded yet (connection URL undefined), typos in variable names, calling API before initialization in SPA bundles.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src/OrchardCore.Modules/OrchardCore.SignalR/wwwroot/Scripts/signalr.js:318

    log(_logLevel, _message) {
    }
}
/** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */
NullLogger.instance = new NullLogger();

;// CONCATENATED MODULE: ./src/Utils.ts
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


// Version token that will be replaced by the prepack command
/** The version of the SignalR client. */
const VERSION = "8.0.17";
/** @private */
class Arg {
    static isRequired(val, name) {
        if (val === null || val === undefined) {
            throw new Error(`The '${name}' argument is required.`);
        }
    }
    static isNotEmpty(val, name) {
        if (!val || val.match(/^\s*$/)) {
            throw new Error(`The '${name}' argument should not be empty.`);
        }
    }
    static isIn(val, values, name) {
        // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.
        if (!(val in values)) {
            throw new Error(`Unknown ${name} value: ${val}.`);
        }
    }
}
/** @private */
class Platform {
    // react-native has a window but no document so we should check both
    static get isBrowser() {

View on GitHub (pinned to 4306c0717f)