Skip to content

Add information about strict_mode for encore #16207

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

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions frontend/encore/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,24 @@ running it (e.g. when executing ``yarn encore dev``). Fix this issue calling to
// ... the rest of the Encore configuration

.. _`Webpack integration in PhpStorm`: https://www.jetbrains.com/help/phpstorm/using-webpack.html

My functional tests are failing in CI
-------------------------------------

With something along the lines of

.. code-block:: text

Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "/var/www/html/public/build/entrypoints.json" does not exist.

..

This is happening because you did not build your encore assets, hence no ``entrypoints.json`` file. Plus encore is working in strict mode by default, which causes twig functions ``encore_entry_*`` to panic.

To solve that you can add this to your ``config/packages/test/webpack_encore.yaml``

.. code-block:: yaml

webpack_encore:
strict_mode: false
..