How do I require a file in a shortcode?

Shortcodes are expected to return content, not echo it out. So if your shortcode_file.php file is straight html, it’s considered being echoed.

If that’s the case, you could do something like :

function shortcode_name(){
    ob_start();
    require_once ( plugin_dir_path(__FILE__) . '/shortcode_file.php');
    $content = ob_get_clean();
    return $content;
};