vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.88k stars 1.18k forks source link

Vue3, Router4 problem #2274

Closed juliusfriedman closed 3 months ago

juliusfriedman commented 3 months ago

Vue version

^3.4.21

Link to minimal reproduction

https://github.com/juliusfriedman/vue-project

Steps to reproduce

Run project

What is expected?

Entire page loads

What is actually happening?

only displays html comment vnode `` where router import should be. No error in console etc. ### System Info ```shell All systems but only when externalizing all depencies in production mode, if I run in debug or if I remove the externalization for vue-router everything works as expected, if I instead try to internalize vue and externalize vue-router other strange issues occur. ``` ### Any additional comments? See also my question about this same problem on [StackOverflow](https://stackoverflow.com/questions/78639922/vue-3-router-issue-no-outlet-no-displayed-content?noredirect=1#comment138646499_78639922) Thanks in advance for your help! If you require any additional information please let me know and I will provide ASAP!
yangliguo7 commented 3 months ago

I cannot reproduce this issue on my end. need more information

maybe relate to ur version

juliusfriedman commented 3 months ago

What can't you reproduce? Locally when I build in production mode I only see the component rendered on the Home page but not the imported data of the router-view.

Are you saying when you build in production mode you are able to view the entire page and browse to home and about pages?

Let me know what other information I could possibly provide..,

Thank you!

P.s Have tried multiple versions of vue and vue-router... and removing the line of vue-router from the externals definition solves the problem but costs another 80kb

This is what I see in prod mode... image

jh-leong commented 3 months ago

I tried removing the external configuration for vue-router in vite.config.ts under rollupOptions, and everything worked fine.

You might want to check the issues in the vue-router repository for more information.

image