github symfony/webpack-encore-bundle v1.7.3
Bug fix: missing CSS/JS after some exceptions

latest releases: v1.16.0, v1.15.1, v1.15.0...
4 years ago

Hi friends!

This release contains a single bug fix for a tricky issue: you render a Twig template (which uses the encore_entry_link_tags() and encore_entry_script_tags() functions) and then an exception (for some reason) is thrown, Symfony would correctly render your error template BUT any calls to encore_entry_link_tags() in that template would render no link/script tags because they were "already rendered". This is due to an important feature in WebpackEncoreBundle where any link or script tag is never rendered multiple times... to avoid having the same JS or CSS file rendered on the same page multiple times.

However, in the case of an exception that's thrown in Twig, WebpackEncoreBundle would think that a JS or CSS file had been rendered, but in reality, the HTML it was rendered into was never used - because the exception caused that HTML to not be used and for the "error" page to be used instead.

This was fixed in #74 thanks to @tbmatuka and @ckrack by adding an exception listener that "resets" this bundle's "memory" of what it has rendered.

If you experience any adverse effects, please open an issue :).

Happy packing!

Don't miss a new webpack-encore-bundle release

NewReleases is sending notifications on new releases.