Why is this block found but not installed? I have a custom block that is found by "Place Block" but does not actually get placed. The spinny just spins for second and then nothing happens; the screen just stays at the list of available blocks.


Is there any method within Drupal 8 to see what the error is?
What incompatibilities might be causing this?


Setup Notes


Drupal 8.1
Lots of cache refreshing attempts
Lots of uninstall/reinstall attempts
Same behavior on a fresh D8 install
The module does install and the controller works at its prescribed URL
The base directory of the module is nrs_raceroftheday


This is the content of ROTDBlock.php.

/**
 * @file
 * Contains \Drupal\nrs_raceroftheday\Plugin\Block\ROTDBlock. 
 */

namespace Drupal\nrs_raceroftheday\Plugin\Block;
use Drupal\Core\Block\BlockBase;

/**
 * Provides a 'Racer Of the Day' Block
 *
 * @Block(
 *   id = "rotd_block",
 *   admin_label = @Translation("RacerOTD v4 block"),
 *   )
 */
class ROTDBlock extends BlockBase {
  /**
   * {@inheritdoc}
   */
  public function build() 
    {
    $pageContent='asdf';
    return array('#markup' =&gt; $this-&gt;t($pageContent),  );
  }
}


Here's the routing file nrs_raceroftheday.routing.yml.

nrs_raceroftheday.controller:
  path: '/racer-of-the-day'
  defaults:
    _controller: 'Drupal\nrs_raceroftheday\Controller\NrsRacerOfTheDayController::content'
    _title: 'Racer of the Day'
  requirements:
    _permission: 'access content'
In general, that can have many possible causes. But it's very likely some sort of syntax or other error that leads to an exception or a fatal error.

Open the Place block link in a new tab to see the response, check the network tab and/or check your apache or drupal logs.

That should give you a hint about the problem. In this specific example, it was a trailing space after the closing PHP tag, as suggested by @kiamlaluno, that's why Drupal coding standard says that they should be left out.