single-spa / single-spa-react

Single-spa lifecycles helper for React applications
https://single-spa.js.org/docs/ecosystem-react.html
MIT License
227 stars 63 forks source link

single-spa routing doesn't work after deployment to s3 bucket #188

Closed JMRaghu closed 1 year ago

JMRaghu commented 1 year ago

Root application and other mfe's are deployed to s3 bucket i was able to load the first page("/") of the appli-cation, But if i navigate to other page it throws error not found. I have used microfrontend-layout to define the single-spa-router

Microfrontend-layout.html

<application name="@TEST/app1"></application>
  <main>
    <route
        path="/" exact>
        <application name="@TEST/app2"></application>
    </route>
    <route
        path="/contact">
        <application name="@TEST/app3"></application>
    </route>
    <route
        path="/angular">
        <application name="angular-app"></application>
    </route>
    <route
        path="/mfe1">
        <application name="@TEST/mfe1"></application>
    </route>
    <route
        path="/app4">
        <application name="@TEST/app4"></application>
    </route>
    <route default>
        <h1>404 Not Found</h1>
        <application name="@TEST/"></application>
      </route>
    </main>
</single-spa-router>

so i am running 'yarn run build' to create my dist folder and upload it in the bucket manually without any yml file/pipeline i guess the route is not working when deployed

Locally it is working perfectly

is there anything that needs to be added before deployment?

Can anyone help me with this issue?

MilanKovacic commented 1 year ago

Closing due to inactivity. Feel free to reopen the issue if the problem still persists.