Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX] Better error message when symfony/templating is needed #27468

Closed
javiereguiluz opened this issue Jun 1, 2018 · 1 comment
Closed

[DX] Better error message when symfony/templating is needed #27468

javiereguiluz opened this issue Jun 1, 2018 · 1 comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony)

Comments

@javiereguiluz
Copy link
Member

Description
As reported on Symfony Docs (symfony/symfony-docs#9867):

I created a new Symfony project and added Twig. I also added an external Bundle that use the syntax FooBarBundle::template.html.twig and I got this exception:

Unable to find template "FooBarBundle::template.html.twig" (looked into: /srv/templates, /srv/templates).

Possible Solution
If the not found template contains : and symfony/templating is not installed, display a different error message explaining the user that they must install symfony/templating.

@javiereguiluz javiereguiluz added the DX DX = Developer eXperience (anything that improves the experience of using Symfony) label Jun 1, 2018
@fabpot
Copy link
Member

fabpot commented Jun 5, 2018

I would recommend to fix the third party bundle. Adding symfony/templating would work of course, but that comes with a performance penalty and this is not a long term solution. I agree though that a better error message would be nice.

nicolas-grekas added a commit that referenced this issue Jun 19, 2018
…noushnorouzi)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBundle] Enhance the twig not found exception

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27468
| License       | MIT
| Doc PR        | -

Improve error message to make it clear to developers what mistake they have made.

Commits
-------

32988b4 Enhance the twig not found exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony)
Projects
None yet
Development

No branches or pull requests

3 participants