8000 Adding instructions to prevent CORS errors · symfony/symfony-docs@a68e133 · GitHub
[go: up one dir, main page]

Skip to content

Commit a68e133

Browse files
lambertbeekhuisjaviereguiluz
authored andcommitted
Adding instructions to prevent CORS errors
1 parent c6f402b commit a68e133

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)
0