Bundle twig and namespace "There are no registered paths for namespace ..."


#1

I’ve created a bundle and everything works as expected; however, I get “There are no registered paths for namespace TechPack” when trying to render a template within a controller (e.g. $this->renderView(’@TechPack/TechPack/defaultProductPreview.html.twig’)). I’ve tried every combination.

Below is the dir structure:

TechPackBundle/
├── Controller
├── DependencyInjection
├── EventListener
├── Resources
│ ├── config
│ ├── public
│ └── views
│ ├── default.html.twig
│ ├── layout.html.twig
│ └── TechPack
│ ├── default.html.twig
│ ├── defaultPackagingPreview.html.twig
│ ├── defaultPatternPreview.html.twig
│ ├── defaultProductPreview.html.twig
│ ├── includes
│ │ ├── components
│ │ │ ├── attributes
│ │ │ │ └── carelabel.html.twig
│ │ │ ├── card_header_circle_tag.html.twig
│ │ │ ├── care_label.html.twig
│ │ │ ├── packaging_bom.html.twig
│ │ │ └── patterns
│ │ │ └── table_ProductPattern.html.twig
│ │ ├── defaultPatternPreview.html.twig
│ │ ├── packaging_components.html.twig
│ │ └── product_bom.html.twig
│ └── layout.html.twig
├── TechPackBundle.php
└── Twig
└── InstanceOfExtension.php

./bin/console debug:twig shows:
@TechPack src/TechPackBundle/Resources/views/
@!TechPack src/TechPackBundle/Resources/views/


#2

I can’t explain it and I’m not aware of having changed anything but it just started working.