Lazy Load Module - Angular MVC Template - Hard reload doesn't work? #849

Closed
opened 2025-08-09 17:17:54 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @aherrick on 4/7/2017

I'm seeing something strange.

I've followed this to enable Lazy Loading of modules in my App.

7ded0a0b60

Once the App loads and I navigate to the route via URL it works without issue. URL is /configuration just to note.

However, once I'm on that /configuration module, if I do a hard refresh, it's like the MVC backend kicks in and attempts to resolve the Controller/Action (which obviously doesn't exist)

1

My MVC routes haven't changed and are base:

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });

Am I missing something here? Why would "MVC" be trying to load /configuration instead of letting it fall to Angular?

NOTE: If I change the route to "config" reloading/navigating works as expected. Is something special about "configuration" (seems very odd to me unless I'm overlooking something)

*Originally created by @aherrick on 4/7/2017* I'm seeing something strange. I've followed this to enable Lazy Loading of modules in my App. https://github.com/aspnet/JavaScriptServices/commit/7ded0a0b60ce3a5356417a5d6102a376fe5f6802 Once the App loads and I navigate to the route via URL it works without issue. URL is /configuration just to note. However, once I'm on that /configuration module, if I do a hard refresh, it's like the MVC backend kicks in and attempts to resolve the Controller/Action (which obviously doesn't exist) ![1](https://cloud.githubusercontent.com/assets/586671/24816580/4a932812-1ba7-11e7-8236-42d872dca5e6.png) My MVC routes haven't changed and are base: ``` app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); ``` Am I missing something here? Why would "MVC" be trying to load /configuration instead of letting it fall to Angular? **NOTE:** If I change the route to "config" reloading/navigating works as expected. Is something special about "configuration" (seems very odd to me unless I'm overlooking something)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#849
No description provided.