У меня есть сервер, работающий по адресу localhost: 5000, и я затем использую http-proxy-middleware для подключения моего клиента разработки следующим образом:
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use(proxy('/auth/google',
{ target: 'http://localhost:5000/' }
));
app.use(proxy('/api/*',
{ target: 'http://localhost:5000/' }
));
}
Но прокси не работает. Я получаю следующее:
Error: Unable to resolve module `./debugger-ui/debuggerWorker.d9da4ed7` from ``:
None of these files exist:
* debugger-ui/debuggerWorker.d9da4ed7(.native|.native.expo.ts|.expo.ts|.native.expo.tsx|.expo.tsx|.native.expo.js|.expo.js|.native.expo.jsx|.expo.jsx|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.wasm|.wasm)
* debugger-ui/debuggerWorker.d9da4ed7/index(.native|.native.expo.ts|.expo.ts|.native.expo.tsx|.expo.tsx|.native.expo.js|.expo.js|.native.expo.jsx|.expo.jsx|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.wasm|.wasm)
at ModuleResolver.resolveDependency (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
at ResolutionRequest.resolveDependency (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
at /Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/lib/transformHelpers.js:267:42
at /Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/Server.js:1305:37
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/Server.js:99:24)
at _next (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/Server.js:119:9)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[Unhandled promise rejection: Error: Network Error]
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:154704:26 in createError
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:154606:27 in handleError
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:32436:31 in dispatchEvent
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31520:33 in setReadyState
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31347:29 in __didCompleteResponse
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:7023:42 in emit
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2774:49 in __callFunction
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2487:31 in <unknown>
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2728:15 in __guard
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2486:21 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue
* http://localhost:19003/debugger-ui/debuggerWorker.d9da4ed7.js:4:907 in <unknown>
Почему это может быть?