Skip to content
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

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

Open
engineervix opened this issue Mar 16, 2024 · 0 comments
Open

Comments

@engineervix
Copy link
Owner

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",
+        },
+      ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant