I have two projects I am trying to deploy to domains ‘leadgem-website.netlify.app/’ and ‘leadgem-website.netlify.app/dashboard/’, but the second route is not working.
My first website, (‘leadgem-website.netlify.app’, the ‘/‘ route), appears to work well, and is a simple Vue 2 project. My redirects look like the following for this site:
[[redirects]]
from = "/"
to = "/index.html"
status = 200
[[redirects]]
from = "/login"
to = "/index.html"
status = 200
[[redirects]]
from = "/signup"
to = "/index.html"
status = 200
[[redirects]]
from = "/dashboard"
to = "https://leadgem-dashboard.netlify.app/"
status = 200
My second website, ‘leadgem-dashboard.netlify.app’, the ‘/dashboard/‘ route, uses Vue 3 and Vite, and there are about three different places to specify the “base” route that the site is deployed on. Once in the router as an argument to the Vue’s “createWebHistory” function (API Documentation | Vue Router), once in my vite.config.js as “base” (Configuring Vite | Vite), and once in my vue.config.js as “publicPath” (Configuration Reference | Vue CLI). I’ve tried about every combination I can think of among the three, setting all to ‘/dashboard/’, setting some to ‘/‘, etc… For context, my build command is vite build
, and I’m trying to serve files out of a standard dist/
folder.
My redirects file for the dashboard website looks like the following:
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Have been seeing two different errors on the dashboard route so far. One failure mode is just 404’s on all the assets, and the other is a strange “Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/html”. Strict MIME type checking is enforced for module scripts per HTML spec” error. Not super sure what to make of the latter.
My questions are then, given nested routing of two applications that manage their own routes, what should the netlify.toml look like for both projects?
And for the second website, the ‘/dashboard/‘ route, what should all those config files look like? Should all of them be pointing to the ‘/dashboard/‘ route, or some combination of ‘/dashboard/’ and ‘/‘?
Thanks!