antfu-collective / vite-ssg

Static site generation for Vue 3 on Vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My project can run, but it can't be packaged

admin8756 opened this issue · comments

I guess element plus uses document. But I can't find where this code is.

image

commented

This is usually an issue with a component not being registered in Vue when referencing it in some other component. Somehow in dev mode it usually still works.

I suggest you go to node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js:2166 and insert a console.log right before cache.set:

  console.log('set in cache', comp);
  cache.set(comp, /* ... */);

This should print out the component last whichever was not found. Make sure you register it correctly.

I have the same error and when I follow your advice it get this in the console:

set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$5]
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$6],
__scopeId: 'data-v-7f4a0e1f'
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$a]
}
set in cache center
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$7]
}
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$7]
}
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$5]
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$6],
__scopeId: 'data-v-7f4a0e1f'
}
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$8]
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$3]
}
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$8]
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$2]
}
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$8]
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$1]
}
set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] }
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender$8]
}
set in cache {
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender]
}

This is usually an issue with a component not being registered in Vue when referencing it in some other component. Somehow in dev mode it usually still works.

I suggest you go to node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js:2166 and insert a console.log right before cache.set:

  console.log('set in cache', comp);
  cache.set(comp, /* ... */);

This should print out the component last whichever was not found. Make sure you register it correctly.

Thank you for your reply. I haven't solved the problem. But I solved the element plus problem. Because I used it in another project. Element plus, I don't think it suits me very well. So I returned the original version.

I have the same error and when I follow your advice it get this in the console:

set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$5] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$6], __scopeId: 'data-v-7f4a0e1f' } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$a] } set in cache center set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$7] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$7] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$5] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$6], __scopeId: 'data-v-7f4a0e1f' } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$8] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$3] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$8] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$2] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$8] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$1] } set in cache { __ssrInlineRender: true, setup: [Function (anonymous)] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender$8] } set in cache { setup: [Function (anonymous)], ssrRender: [Function: _sfc_ssrRender] }

hey . buddy. I don't recommend you using element plus. Because its mobile terminal adaptation is too bad.

commented

Hmm ok, I thought the component names would have been logged out as well.
I think this approach worked with a vitepress project once but does appearently not work here.

In case you can share a reproduction of the problem I can dig a bit deeper and try to make the error message better.

Hmm ok, I thought the component names would have been logged out as well. I think this approach worked with a vitepress project once but does appearently not work here.

In case you can share a reproduction of the problem I can dig a bit deeper and try to make the error message better.

i 'm sorry. I'd love to repeat it. But when I used element plus again according to the document, there was no problem. So it may be because one of the installation steps is wrong. It may also be because I want to use the ES version of element plus

commented

Ok, I think in that case you can close the issue. Feel free to reopen if the issue or create a new one when it occurs again.