BabylonJS/Babylon.js · error

The loader plugin corresponding to the '${pluginExtension}'

Error message

The loader plugin corresponding to the '${pluginExtension}' file type has not been found. If using es6, please import the plugin you wish to use before.

What it means

A plugin registration matched the extension metadata, but the actual plugin instance/factory was not available when loading started. This typically happens in ES6/tree-shaking builds where the loader module was never imported, so the factory registry is empty even though the extension string was supplied.

Source

Thrown at packages/dev/core/src/Loading/sceneLoader.ts:734

    // much simpler as we can just pass the options to the factory, rather than passing options through to every possible
    // plugin call. Given this, options are only supported for plugins that provide a factory function.
    let plugin: SceneLoaderPlugin;
    if (IsFactory(registeredPlugin.plugin)) {
        const pluginFactory = registeredPlugin.plugin;
        try {
            // Only await when the factory is actually asynchronous, so that for synchronous factories the plugin is
            // instantiated (and onPluginActivatedObservable is notified) synchronously within the calling load operation.
            const createdPlugin = pluginFactory.createPlugin((pluginOptions ?? {}) as SceneLoaderPluginOptions);
            plugin = createdPlugin instanceof Promise ? await createdPlugin : createdPlugin;
        } catch (error) {
            throw createLoadError(fileInfo, "Error instantiating plugin.", error);
        }
    } else {
        plugin = registeredPlugin.plugin;
    }

    if (!plugin) {
        throw new Error(`The loader plugin corresponding to the '${pluginExtension}' file type has not been found. If using es6, please import the plugin you wish to use before.`);
    }

    onPluginActivatedObservable.notifyObservers(plugin);

    // Check if we have a direct load url. If the plugin is registered to handle
    // it or it's not a base64 data url, then pass it through the direct load path.
    if (directLoad && ((plugin.canDirectLoad && plugin.canDirectLoad(fileInfo.url)) || !IsBase64DataUrl(fileInfo.url))) {
        if (plugin.directLoad) {
            let data: unknown;
            try {
                data = await plugin.directLoad(scene, directLoad);
            } catch (error) {
                throw createLoadError(fileInfo, "Error in directLoad of _loadData: " + error, error);
            }
            return { plugin, data };
        }
        return { plugin, data: directLoad };
    }

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Add a side-effect import of the needed loader: import "@babylonjs/loaders/glTF"; before any load call.
  2. If using dynamic loading, await the loader module import before calling SceneLoader.
  3. In UMD setups, include the loaders .js script bundle on the page.

Example fix

// before
import { SceneLoader } from "@babylonjs/core";
await SceneLoader.ImportMeshAsync("", root, "model.glb", scene); // plugin not found

// after
import { SceneLoader } from "@babylonjs/core";
import "@babylonjs/loaders/glTF";
await SceneLoader.ImportMeshAsync("", root, "model.glb", scene);
Defensive patterns

Strategy: fallback

Validate before calling

function ensureGlTFLoaded(): void {
  if (!BABYLON.SceneLoader.IsPluginForExtensionAvailable(".glb")) {
    throw new Error("glTF loader not imported — add import '@babylonjs/loaders/glTF'");
  }
}

Try / catch

try {
  await BABYLON.SceneLoader.ImportMeshAsync("", root, file, scene);
} catch (e) {
  if ((e as Error).message.includes("has not been found")) {
    await import("@babylonjs/loaders/glTF");
    return BABYLON.SceneLoader.ImportMeshAsync("", root, file, scene);
  }
}

Prevention

When it happens

Trigger: Calling SceneLoader with an explicit pluginExtension (e.g. "glb") in an ES6 project without importing "@babylonjs/loaders/glTF" (or equivalent) beforehand.

Common situations: Vite/webpack tree-shaking removing the loaders package because only SceneLoader was referenced; dynamic-import-based bundlers where loaders load after the scene load begins; UMD-to-ES6 migration dropping global BABYLON loader scripts.

Related errors


AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30). Data as JSON: /api/errors/c930c330e2c35bfd. Report an issue: GitHub.