Twig: Attempted to call an undefined method named "getFilename" of class "Twig_TokenStream"

Created on 18 Oct 2016  ·  8Comments  ·  Source: twigphp/Twig

When attempting to load any template.

in vendor/symfony/assetic-bundle/Twig/AsseticTokenParser.php at line 49

// check the bundle $templateRef = null; try { $templateRef = $this->templateNameParser->parse($this->parser->getStream()->getFilename()); } catch (\RuntimeException $e) { // this happens when the filename isn't a Bundle:* url // and it contains ".."

Most helpful comment

Hi, is this still an issue? I'm getting this error now when trying to use multiple javascript files.

All 8 comments

@mhallnoinc use Twig 1.x rather than the dev version of Twig 2 (which can be used only if you allow composer to install dev versions btw). Twig 2 made some additional BC breaks in the past few days, and I have not updated AsseticBundle yet for them.

Closing as Assetic is going to catch up at some point

cool, thanks makes sense.

Hi, is this still an issue? I'm getting this error now when trying to use multiple javascript files.

I also got this mistake. Then I saw that I inserted single stylesheets separated by commas. After I fixed that, it worked.

So, the error is not the error above - it's the error message wich is not really helpfull.

Yeah, there would still be an error, but this is was an error from trying to throw that error. Is it still present?

Yes, I got this error an hour ago..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

koflerdavid picture koflerdavid  ·  3Comments

mnapoli picture mnapoli  ·  5Comments

dvladimirov77 picture dvladimirov77  ·  5Comments

garak picture garak  ·  5Comments

mpdude picture mpdude  ·  3Comments