Why do I get Template "@bartik/block" is not defined? So I've created a small subtheme called bartik_graphql. It just overrides the 'Powered by Drupal' block. Besides it's bartik_graphql.info.yml file it has a templates directory containing one file block--bartik-graphql-powered.html.twig.

Contents of block--bartik-graphql-powered.html.twig:

{#graphql
query {
  admin:userById(id: "1") {
    name
  }
}
#}

{% extends "@bartik/block" %}

{% block content %}
  &lt;div{{ content_attributes.addClass('content') }}&gt;
    {{ content }} and some guy named {{ graphql.data.admin.name }}
  &lt;/div&gt;
{% endblock %}


I've enabled my subtheme and set it to default. However I receive the following error:


  Twig\Error\LoaderError: Template "@bartik/block" is not defined. in
  Twig\Loader\ChainLoader->getCacheKey() (line 122 of
  web/core/themes/bartik/templates/page.html.twig).


What I expect to happen is have my subtheme's template override what is used by default to display the 'Powered by Drupal' message.

Drupal: 8.7.8
PHP: 7.2.17

Am I using extends wrong here?
I didn't know of Twig namespacing just until now. But what always worked for
extends and includes is to point to the template you want to extend/include directly, with the path starting from Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}


You could also try the following which seems to follow theme inheritance but only up to the final base theme (which would be Classy).

{% extends "@block/block.html.twig" %}