From 2edd1d490a06f0de496cb402747247f7eeea5dd3 Mon Sep 17 00:00:00 2001 From: dreitagebart Date: Sun, 1 Mar 2020 16:05:08 +0100 Subject: [PATCH] http-proxy-middleware require has changed Since http-proxy-middleware has a version higher v1.x.x the import of the require statement has changed... Please refer to docs --> https://github.com/chimurai/http-proxy-middleware I had that issue when I installed this package with version > 1.x. During build process I got that error proxy is not defined. Well, the import has changed, as I said. Hope that helps and thank you for CRA. Keep up the good work! --- docusaurus/docs/proxying-api-requests-in-development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/proxying-api-requests-in-development.md b/docusaurus/docs/proxying-api-requests-in-development.md index 3fdfb778069..cb1d3248a93 100644 --- a/docusaurus/docs/proxying-api-requests-in-development.md +++ b/docusaurus/docs/proxying-api-requests-in-development.md @@ -95,12 +95,12 @@ module.exports = function(app) { You can now register proxies as you wish! Here's an example using the above `http-proxy-middleware`: ```js -const proxy = require('http-proxy-middleware'); +const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { app.use( '/api', - proxy({ + createProxyMiddleware({ target: 'http://localhost:5000', changeOrigin: true, })