engineervix / cookiecutter-wagtail-vix

a minimal, batteries-included, reusable project skeleton to serve as a starting point for a Wagtail project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check webpack dev server config -- options.proxy should be an array

engineervix opened this issue · comments

Newer versions* will throw an exception:

01:19:24 frontend.1 | > webpack serve
01:19:24 frontend.1 |
01:19:25 frontend.1 | [webpack-cli] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
01:19:25 frontend.1 |  - options.proxy should be an array:
01:19:25 frontend.1 |    [object { … } | function, ...]
01:19:25 frontend.1 |    -> Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.
01:19:25 frontend.1 |    -> Read more at https://webpack.js.org/configuration/dev-server/#devserverproxy
01:19:25 system     | frontend.1 stopped (rc=2)

  • encountered this on another build that wasn't created from this cookiecutter (with "webpack-dev-server": "^5.0.3")

As indicated in console, see https://webpack.js.org/configuration/dev-server/#devserverproxy. What you wanna do is

-      proxy: {
-        context: () => true,
-        target: "http://web:8000",
-      },
+      proxy: [
+        {
+          context: () => true,
+          target: "http://web:8000",
+        },
+      ],