gpt4 book ai didi

angular - 错误 : [HPM] Invalid context. 期待类似 : "/api" or ["/api", "/ajax"的东西]

转载 作者:行者123 更新时间:2023-12-04 01:47:29 26 4
gpt4 key购买 nike

从现在开始,我收到以下错误,而我的 Angular 7 项目中没有任何更改。直到昨天它没有给出这个错误。

Error: [HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]
at Object.matchContext [as match] (E:\Java\GitWorkspace\FE-Router\node_modules\http-proxy-middleware\lib\context-matcher.js:40:9)
at shouldProxy (E:\Java\GitWorkspace\FE-Router\node_modules\http-proxy-middleware\lib\index.js:82:27)
at middleware (E:\Java\GitWorkspace\FE-Router\node_modules\http-proxy-middleware\lib\index.js:39:9)
at app.use (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\lib\Server.js:347:22)
at Layer.handle [as handle_request] (E:\Java\GitWorkspace\FE-Router\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (E:\Java\GitWorkspace\FE-Router\node_modules\express\lib\router\index.js:317:13)
at E:\Java\GitWorkspace\FE-Router\node_modules\express\lib\router\index.js:284:7
at Function.process_params (E:\Java\GitWorkspace\FE-Router\node_modules\express\lib\router\index.js:335:12)
at next (E:\Java\GitWorkspace\FE-Router\node_modules\express\lib\router\index.js:275:10)
at goNext (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\middleware.js:16:16)
at processRequest (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\middleware.js:64:26)
at ready (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\util.js:52:12)
at handleRequest (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\util.js:168:5)
at Promise (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\middleware.js:39:7)
at new Promise (<anonymous>)
at middleware (E:\Java\GitWorkspace\FE-Router\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\middleware.js:38:12)

这是我的 proxy.config.json
{
"/*": {
"target": "http://localhost:8088",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}

}

此错误消息背后的原因是什么。我怎样才能消除这个错误。请帮忙。

最佳答案

/*不是有效的语法。对于代理所有请求,我们可以使用例如 /或通配符 **http-proxy-middleware 中所述

View More Details Here

关于angular - 错误 : [HPM] Invalid context. 期待类似 : "/api" or ["/api", "/ajax"的东西],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54684865/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com