No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Vue router mode 'hash' issue in dev

    Help
    1
    2
    622
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Hawkeye64
      Hawkeye64 last edited by

      We are heavily using NGINX and sockets to chain several computers, some of which are behind NAT. To get this all to work, we recently had to change our Vue Router Mode from history to hash. We’re seeing 1 issue when you execute quasar dev and the web page automatically appears. The browser URL becomes this:
      localhost/index.html#/
      When it should just be this:
      localhost/#/
      The first instance gives us all kinds of errors because location.path becomes incorrect for NGINX usage. As I said, this is only an issue in dev mode when the browser automatically starts.

      Does anyone know where this is initiated?

      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by

        Instead of changing quasar sources, I have just done the following in my client start up:

            if (process.env.NODE_ENV !== 'production') {
              if (location.href.indexOf('index.html') > -1) {
                let redirectPath = location.href.replace('index.html', '')
                window.location = redirectPath
                return
              }
            }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post