Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Aug 14, 2020 · 5 comments

Comments

@rick0907
Copy link

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
Copy link

Sidewinder1138 commented Sep 18, 2020

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
Copy link
Member

bigopon commented Sep 19, 2020

@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
Copy link
Member

3cp commented Sep 19, 2020

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

@3cp
Copy link
Member

3cp commented Sep 19, 2020

@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
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants