Why is my $node always null in my custom block (using plugin contexts)? I am trying to make a block that gets the current node via Plugin Contexts. 

But my $node is always null. Can anyone tell me why?

I am placing the block with the context module if that makes a difference?

&lt;?php

namespace Drupal\my_module\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides a 'Header' block.
 *
 * @Block(
 *   id = "header",
 *   admin_label = @Translation("Header"),
 *   context = {
 *     "node" = @ContextDefinition("entity:node", required = FALSE)
 *   }
 * )
 */
class ProductStickyHeader extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    $build = [];

    $node = $this-&gt;getContextValue('node');
    // $node is always null!

    return $build;
  }
}


Many thanks!
Thanks everyone - turns out the answer was deceptively simple - I had to remove the block using context &amp; then re-add it. When I re-added it there was an extra option in context to use the current node. Then the context plugin worked!