You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at proxyMiddleware (/Users/guanwei/code/company/cbj_pro/cbj_app/node_modules/.pnpm/registry.npmmirror.com+vite@2.7.10_less@4.1.2/node_modules/vite/dist/node/chunks/dep-76613303.js:50062:12)
at Object.preview (/Users/guanwei/code/company/cbj_pro/cbj_app/node_modules/.pnpm/registry.npmmirror.com+vite@2.7.10_less@4.1.2/node_modules/vite/dist/node/chunks/dep-76613303.js:73391:17)
functionproxyMiddleware(httpServer,config){constoptions=config.server.proxy;// lazy require only when proxy is usedconstproxies={};Object.keys(options)......}
Judge is config.preview.proxy, but read is config.server.proxy
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Describe the bug
script:
$ vite preview --config ./vite.config.preview.ts
config file port
Problem location
vite/packages/vite/src/node/preview.ts
Lines 81 to 83 in 870e1c0
Local dependency code
vite/packages/vite/src/node/server/middlewares/proxy.ts
Lines 31 to 40 in 870e1c0
Local dependency code
Judge is
config.preview.proxy
, but read isconfig.server.proxy
Reproduction
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: