Skip to content

Don't require assets in test environment #43

Closed
@karser

Description

@karser

Hello,

Twig functions encore_entry_link_tags / encore_entry_script_tags throw an exception if assets are not compiled:

An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "/var/www/app/public/build/entrypoints.json" does not exist.")

This behavior is annoying when it comes to functional testing. Because building assets for symfony crawler tests is a waste of time.
Currently, I'm using this workaround

    <head>
        {% if app.environment != 'test' %}{{ encore_entry_link_tags('app') }}{% endif %}
    </head>
    <body>
        {% if app.environment != 'test' %}{{ encore_entry_script_tags('app') }}{% endif %}
    </body>

It would be nice to have an option not to throw exceptions for the test environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions