Skip to content

Commit eaa24a5

Browse files
committed
minor #12035 Instructions to prevent CORS for Hot Module Replacement (lambertbeekhuis)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #12035). Discussion ---------- Instructions to prevent CORS for Hot Module Replacement <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- a68e133 Adding instructions to prevent CORS errors
2 parents c6f402b + a68e133 commit eaa24a5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

frontend/encore/dev-server.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,24 @@ option:
3939
HMR currently works for :doc:`Vue.js </frontend/encore/vuejs>`, but does *not* work
4040
for styles anywhere at this time.
4141

42+
For Hot Module Replacement, CORS-errors can appear (Cross Origin Resource Sharing). To handle this, add the --disable-host-check and --port options to your command:
43+
44+
.. code-block:: terminal
45+
46+
$ yarn encore dev-server --port 8080 --disable-host-check --hot
47+
48+
Or, alternatively, you can add the options to your package.json
49+
50+
.. code-block:: package.json
51+
52+
"dev-server": "encore dev-server --port 8080 --disable-host-check",
53+
54+
and run the yarn command as normal:
55+
56+
.. code-block:: terminal
57+
58+
$ yarn dev-server --hot
59+
60+
4261
.. _`webpack-dev-server`: https://webpack.js.org/configuration/dev-server/
4362
.. _`HMR`: https://webpack.js.org/concepts/hot-module-replacement/

0 commit comments

Comments
 (0)