vant-ui/vant-demo

vant-demo nuxt3无法正常运行在生产环境

powerlau opened this issue · 2 comments

执行yarn dev 可以正常运行在开发环境页面也显示正常,运行yarn dev & yarn start 虽然不会报错,但是打开网页终端会显示如下错误,且页面显示不正常。
image

Listening on http://localhost:3000
TypeError: Cannot read properties of null (reading 'proxy')
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\image\Image.js:47:39)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at Object.ssrRenderComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:10220:12)
at _sfc_ssrRender (file:///D:/dev/codes/nuxt3/.output/server/chunks/server.mjs:3437:32)
at renderComponentSubTree (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9860:13)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9811:16)
at Object.ssrRenderComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:10220:12)
[Vue warn]: Component van-image is missing template or render function.
[Vue warn]: provide() can only be used inside setup().
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\image\Image.js:47:39)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at Object.ssrRenderComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:10220:12)
at _sfc_ssrRender (file:///D:/dev/codes/nuxt3/.output/server/chunks/server.mjs:3437:32)
at renderComponentSubTree (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9860:13)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9811:16)
at Object.ssrRenderComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:10220:12)
[Vue warn]: Component van-image is missing template or render function.
[Vue warn]: provide() can only be used inside setup().
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
[Vue warn]: Component van-cell is missing template or render function.
TypeError: Cannot read properties of null (reading 'proxy')
at useRoute (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\composables\use-route.js:36:42)
at setup (D:\dev\codes\nuxt3.output\server\node_modules\vant\lib\cell\Cell.js:50:40)
at callWithErrorHandling (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:7189:22)
at setupStatefulComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6905:29)
at setupComponent (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:6886:11)
at renderComponentVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9795:17)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9901:22)
at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)
at renderVNode (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9893:13)

at renderVNodeChildren (file:///D:/dev/codes/nuxt3/.output/server/chunks/index.mjs:9916:9)

[Vue warn]: Component van-cell is missing template or render function.

@chenjiahan

我遇到了这个问题


[nuxt] [request error] The requested module 'vant' does not provide an export named 'AddressEdit'
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)  
  at async Promise.all (index 0)  
  at async ESMLoader.import (node:internal/modules/esm/loader:385:24)  
  at async ./server/chunks/handlers/renderer.mjs:11130:24  
  at async ./server/chunks/handlers/renderer.mjs:11186:64  
  at async ./server/node_modules/h3/dist/index.mjs:417:19  
  at async nodeHandler (./server/node_modules/h3/dist/index.mjs:367:7)  
  at async ufetch (./server/node_modules/unenv/runtime/fetch/index.mjs:9:17)  
  at async $fetchRaw2 (./server/node_modules/ohmyfetch/dist/chunks/fetch.mjs:131:20)

image

我这个打包generate的时候出的错,dev时候没问题