joeldenning / vite-single-spa-example

MIT License
63 stars 25 forks source link

import static resource error #4

Closed patrick-Xu closed 3 years ago

patrick-Xu commented 3 years ago

Error when i import static resource,any solution for that?thank you.

image

image

lovetingyuan commented 3 years ago

https://github.com/vitejs/vite/issues/3107 the same issue

lovetingyuan commented 3 years ago

https://github.com/vuejs/vue-next/pull/2477 does this work correctly?

patrick-Xu commented 3 years ago

Url is the current server path. image

joeldenning commented 3 years ago

I commented at https://github.com/vitejs/vite/issues/3107#issuecomment-840688149 with an update on this. It seems that Vite 2 seems to have broken this, as originally https://github.com/vuejs/vue-next/pull/2477 was all that was needed to support this. But now Vite 2 is modifying the base during the serve target in a way that breaks things.

joeldenning commented 3 years ago

Going to close this in favor of https://github.com/vitejs/vite/issues/3107. Later, I may be able to look further into that issue to create a pull request to fix it. However i spent a couple hours on it now and need to move onto other things for the rest of the day (have >100 github issues and slack messages to respond to!)

patrick-Xu commented 3 years ago

it didn find this resource in parent application in localhost 8080 ,the correct one should be the child application in localhost 3000。how can i solve this problem? image

joeldenning commented 3 years ago

My comments above explain this - it's a bug in Vite. The issue linked to above is the tracking issue within Vite for this.