get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR

This is how i set my content directory in wp-config.php

// ========================
// Custom Content Directory
// ========================
define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/somedir' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/somedir' );

error code: 523