marmelab/react-admin · info

Providing an auth-provider when using ra-supabase is not sup

Error message

Providing an auth-provider when using ra-supabase is not supported. It will be ignored.

What it means

The create-react-admin CLI warns that when the chosen data provider is ra-supabase, an --auth-provider flag is incompatible because ra-supabase bundles its own auth provider. The supplied value is ignored and the auth provider is set to 'none' to avoid double configuration.

Source

Thrown at packages/create-react-admin/src/cli.tsx:45

};

const authProviderShortcuts = {
    local: 'local-auth-provider',
};

const getAuthProviderName = (authProvider: string | undefined) => {
    if (authProviderShortcuts[authProvider]) {
        return authProviderShortcuts[authProvider];
    }
    return authProvider;
};

const getAuthProvider = (flags: typeof cli.flags) => {
    if (
        getDataProviderName(flags.dataProvider) === 'ra-supabase' &&
        flags.authProvider != null
    ) {
        console.warn(
            'Providing an auth-provider when using ra-supabase is not supported. It will be ignored.'
        );
        return 'none';
    }
    if (flags.authProvider) return getAuthProviderName(flags.authProvider);
    if (getDataProviderName(flags.dataProvider) === 'ra-supabase')
        return 'none';
    if (flags.interactive) return undefined;
    return 'none';
};

const getDefaultInstaller = (userAgent: string) => {
    if (!userAgent) return 'npm';
    const pkgSpec = userAgent.split(' ')[0];
    const pkgSpecArr = pkgSpec.split('/');
    return pkgSpecArr[0];
};

View on GitHub (pinned to 051f511bb0)

Solutions

  1. Remove the --auth-provider flag from the command when using ra-supabase.
  2. Keep ra-supabase's built-in auth provider configuration in the generated app.
  3. If a custom auth provider is required, choose a different data provider.

Example fix

// before
npx create-react-admin my-admin --data-provider supabase --auth-provider local
// after
npx create-react-admin my-admin --data-provider supabase
Defensive patterns

Strategy: validation

Validate before calling

if (dataProvider === 'supabase' && authProvider) {
  throw new Error('--auth-provider is not supported with ra-supabase; remove the flag');
}

Prevention

When it happens

Trigger: Running create-react-app/npm create react-admin with --data-provider ra-supabase (or supabase) together with a non-null --auth-provider flag, e.g. --auth-provider local.

Common situations: Scaffolding a Supabase project while copying a generic command line that always includes --auth-provider; scripting the generator with fixed flags.

Related errors


AI-assisted analysis of marmelab/react-admin@051f511bb0 (2026-08-30). Data as JSON: /api/errors/59253c2a82fa1101. Report an issue: GitHub.