Getting a fatal error like this?
Uncaught Error: Call to a member function get_component() on null in wp-content/plugins/elementor/modules/ai/module.php:442
This comes from the Elementor AI module. When another plugin or theme calls wp_enqueue_media(), Elementor attaches its AI Media Library feature. In some versions, the AI module tries to talk to an internal “AI app” object that is still null, so PHP crashes.
The usual pattern is:
wp_enqueue_media() on the front end or in a custom screen.get_component() on a null object.The good news. Your content and designs are safe. This is a logic bug in the AI integration and a plugin conflict. Below is a safe path to get your site back, fix Elementor, and find the plugin that triggers the crash.
Elementor is throwing this fatal error:
Uncaught Error: Call to a member function get_component() on null in wp-content/plugins/elementor/modules/ai/module.php:442
It looks related to the AI module and the media library. How do I fix this without breaking my site?
Short version
Elementor AI attaches itself to the WordPress media library.
When any code calls wp_enqueue_media(), Elementor runs its AI Media Library hook. In affected versions, that hook tries to get an internal “AI app” object, then calls get_component() on it. If the AI app is not initialized yet, that object is null and PHP stops with this fatal.
You usually fix this by:
wp_enqueue_media() and triggers the AI code, then updating or adjusting that plugin.If you can still open wp admin:
Your site front end may look different while Elementor is off, but the fatal should stop and you can work again.
If you cannot reach wp admin at all:
wp-content/plugins/.elementor folder to elementor-disabled.elementor-pro to elementor-pro-disabled as well.WordPress will treat those plugins as inactive. You will re enable them after the fix.
The core pattern looks like this:
Uncaught Error: Call to a member function get_component() on null
in wp-content/plugins/elementor/modules/ai/module.php:442
If you see the full stack trace, you will often see:
Elementor\Modules\Ai\Module->get_ai_app()Elementor\Modules\Ai\Module->get_ai_connect_url()Elementor\Modules\Ai\Module->enqueue_ai_media_library()do_action('wp_enqueue_media')wp_enqueue_media()So:
wp_enqueue_media() to load the media modal.get_component() throws the fatal.It is a bug or edge case in the AI module combined with how another plugin or screen uses the media library.
Your goal is to:
First make sure you are not stuck on the exact version that introduced the bug.
In wp admin:
The Elementor team has released fixes for several AI module issues in point releases. In some cases, moving from the first release of a major version to the next minor update is enough to stop this fatal.
If the error started right after updating Elementor and you cannot keep that version yet, use Elementor’s built in rollback as a temporary workaround.
Always have a backup before rolling back. This is a temporary fix to get you stable while waiting for a newer patched version.
After updating or rolling back, re activate Elementor if you disabled it in Step 0 and test again.
If the fatal is gone already, you can skip ahead to Verification. If it is still there, continue.
Even if you like AI features, it is wise to turn them off while you troubleshoot. This stops the AI module from attaching to the media library in most places.
This removes the core AI integration hook for many screens.
If you want to go further and hide AI buttons for specific users, Elementor’s docs also explain turning off AI notifications per user profile. For pure stability though, the Features screen is the main one you want.
After turning it off, clear any caching plugin and reload the page that used to crash.
If the fatal is gone, you can leave AI off or later re enable it after Elementor announces a fix for your specific version.
If the fatal still appears, it is time to see which plugin or theme is triggering the AI module.
In many reports, the stack trace shows another plugin calling wp_enqueue_media() when the error occurs. Examples include SEO plugins and hosting partner plugins.
You want to know which plugin or theme file appears right before or after the wp_enqueue_media() call in the error log.
If you do not already have a debug log:
wp-config.php and make sure these lines exist above the “That is all” comment:define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
wp-content/debug.log via FTP or the file manager.Search the log for get_component() on null or modules/ai/module.php. Look at the lines around it.
You should see a path like one of these:
wp-content/plugins/some-plugin/.../something.phpwp-content/themes/your-theme/.../something.phpnear a call to wp_enqueue_media().
That file is the piece of code that calls the media uploader, which then triggers Elementor’s AI hook.
Once you see a plugin name in the stack trace:
If the fatal disappears when that plugin is off, you have confirmed a conflict between that plugin and the current Elementor AI module.
Options from there:
wp_enqueue_media() triggers the Elementor AI module bug.If the fatal still appears even with obvious plugins disabled, do a classic conflict test:
This finds the exact combination that triggers the crash.
Only use this step if you are comfortable adding a small code snippet. It is a temporary workaround that tells WordPress to remove Elementor’s AI media hook once Elementor has loaded.
Add this via a small custom plugin or a code snippets plugin:
<?php
/**
* Temporarily disable Elementor AI media library hook.
*/
add_action( 'plugins_loaded', function () {
if ( class_exists( '\Elementor\Plugin' ) ) {
$plugin = \Elementor\Plugin::instance();
if ( isset( $plugin->modules_manager )
&& method_exists( $plugin->modules_manager, 'get_modules' )
) {
$ai_module = $plugin->modules_manager->get_modules( 'ai' );
if ( $ai_module && method_exists( $ai_module, 'enqueue_ai_media_library' ) ) {
remove_action(
'wp_enqueue_media',
array( $ai_module, 'enqueue_ai_media_library' ),
10
);
}
}
}
} );
What this does:
wp_enqueue_media.This stops Elementor AI from running when other code calls wp_enqueue_media(), so the null get_component() call never happens.
Use this as a band aid on staging first. Long term you still want Elementor and the conflicting plugin updated so you can safely remove the snippet.
If you have:
and the fatal still appears, it is time to open a support ticket.
Include:
debug.log.Send that to:
elementor/modules/ai/module.php.wp_enqueue_media() right before the crash.This gives them the context they need to reproduce and fix the bug on their side.
You are in good shape when:
debug.log mentioning get_component() on null or modules/ai/module.php.Hit Continue Chat below and send me:
debug.log.I can help you narrow down which plugin triggers the AI module and suggest a safe combination of updates, settings, and temporary workarounds.
Scroll down to the contact form below. Enter your name, email, and WordPress needs. Atiba will get back to you as soon as possible.
WP Assistant is a free tool created by Atiba Software, a WordPress design and development company located in Nashville, TN. If you need more personalized WordPress assistance let us know, and we’ll get back to you ASAP!