gioboa / qwik-microfrontend-starter

2 stars 2 forks source link

Failed to fetch dynamically imported module #3

Closed ppusapati closed 1 month ago

ppusapati commented 3 months ago

Rendered page normally but on click events are not triggering in both host and remote applications

on click of Host:

(index):1257 Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL
    at dispatch ((index):1257:33)
    at HTMLDocument.processDocumentEvent ((index):1332:33) 

onclick on remote counter:

Failed to fetch dynamically imported module: http://localhost:4173/remote//%40fs/C%3A%5CUsers%5Cppusa%5CDownloads%5Cmicrofrontend%20qwikjs%5Cqwik-microfrontend-starter-main%5Cremote%5Csrc%5Ccomponents/counter_component_button_onclick_cwtykrjfdae.js?_qrl_parent=C%3ADownloads%5Cmicrofrontend%20qwikjs%5Cqwik-microfrontend-starter-main%5Cremote%5Csrc%5Ccomponents%5CCounter.tsx

is this a working example?

gioboa commented 3 months ago

Hi, to solve that problem you need to update Qwik and Qwik City If I remember correctly, 1.6.0 was a the orrible release with few regressions

ppusapati commented 3 months ago

Thank you. Have upgraded both to Qwik and Qwik City to 1.6.0 and its working.

now if I have multiple routes in remote application. How to handle them in host?

gioboa commented 3 months ago

Can you give me a practical example?

ppusapati commented 3 months ago

Will revisit with a sample code. Until then will close this. Thank you

gioboa commented 3 months ago

You're welcome 😉

ppusapati commented 3 months ago

I'm experiencing two major issues with routing:

1. Admin Application Navigation:

2. Navigation Between MFEs (via Navbar):

Steps to Reproduce:

  1. Clone the repository: qwikjs-microfrontend
  2. Navigate within the admin application.
  3. Attempt to switch between MFEs using the navbar links.

Any guidance would be appreciated!

gioboa commented 2 months ago

@ppusapati if you want to switch MFE you need to use the full URL e.g http://localhost:5174/ for the Admin one