aurelia / router

A powerful client-side router.
MIT License
121 stars 115 forks source link

Can't navigate directly to route when pushState is true in Aurelia js, react js with backend server as .net 4.5 #664

Open rick0907 opened 3 years ago

rick0907 commented 3 years ago

I have a below route configuration: config.options.pushState = true; config.options.root = "/"; config.options.hashChange = false; url: applicationdomain.../displayData this application working locally without any issue but after deploying it to the server, same URL giving me 404 on refresh or direct hit. I read on the net that we need to configure the server to support the push state. however, I couldn't figure out what exactly I need to configure on .Net 4.5 server.

Sidewinder1138 commented 3 years ago

I'm having a similar issue. Just following along with the official Contact Manager Tutorial, I can click on a Contact and the router works, loading the component, and URL changes to: http://localhost:8080/contacts/1

But then if I refresh the browser, I get errors like this: Refused to apply style from 'http://localhost:8080**/contacts/css/**vendors~253ae210.260f15a8e8c173d839a3.chunk.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

It's looking in /contacts/css, which doesn't exist!!

So the router with pushState is not working properly on local, using the default webpack dev server, etc, config that the Aurelia CLI generated for me.

Never a good sign when you can't even get through the official tutorial without running into issues, but even so, Aurelia looks so awesome I'd love to find a way to use it... (and maybe I did something dumb?)

bigopon commented 3 years ago

@3cp I'm not sure if there's something that could affect a freshly generated project, could you help have a look with this? @Sidewinder1138 thanks for commenting on this. Could you help give some info about your local env? CLI/node/npm versrions?

3cp commented 3 years ago

@Sidewinder1138 I am following the tutorial and could not reproduce your error. Could you push your project to GitHub for us to check?

3cp commented 3 years ago

@rick0907 I am not a .net user. But if you still need help, go to https://discourse.aurelia.io for help, there are many .net users around to help.

magento2pwa commented 11 months ago

@rick0907 please let me know it you get a solution for this application working locally without any issue but after deploying it to the server, same URL giving me 404 on refresh or direct hit. we also facing the same issues which is not sloved