Skip to content

[TwigComponent] Error in debug:twig-component with anonymous components in a bundle directory #2171

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

Closed
tacman opened this issue Sep 15, 2024 · 5 comments

Comments

@tacman
Copy link
Contributor

tacman commented Sep 15, 2024

Anonymous components within a bundle work as expected:

bin/console debug:twig-component

| SurvosBootstrap:accordion            |                                                              | @SurvosBootstrap/components/accordion.html.twig            | Anon |
| SurvosBootstrap:dropdown             |                                                              | @SurvosBootstrap/components/dropdown.html.twig             | Anon |
| SurvosBootstrap:tabs                 |                                                              | @SurvosBootstrap/components/tabs.html.twig                 | Anon |

However, if I create a component in a directory, it fails:

# in the bundle's templates/components directory
mkdir tabler && touch tabler/history-widget.html.twig

back to the app

bin/console debug:twig-component
In ComponentFactory.php line 254:
                                                                                                      
  Unknown component "tabler:history-widget". And no matching anonymous component template was found.  
                                                                                                      

debug:twig-component [<name>]
@smnandre
Copy link
Member

What if you test with SurbosBootstrap:tabler:history-widget ?

@tacman
Copy link
Contributor Author

tacman commented Sep 15, 2024

I believe the problem is with the debugger, as indeed a component in a subdirectory works as expected, it's just the debugger that fails.

image

image

@smnandre
Copy link
Member

Oh sorry ... it has been fixed by #2088 and will be released soon (next week probably)

(i need to stop using the 2.x-dev when reproducing issues 🤦‍♂️ )

@smnandre smnandre changed the title [twig-components] Error when anonymous components are in a directory [TwigComponent] Error in debug:twig-component with anonymous components in a bundle directory Sep 15, 2024
@tacman
Copy link
Contributor Author

tacman commented Sep 15, 2024

Funny, I just switched from using 2.x-dev because everything seemed to be working with the release version!

@tacman
Copy link
Contributor Author

tacman commented Sep 15, 2024

fixed by #2088

@tacman tacman closed this as completed Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants