Skip to content
New issue

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

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

Already on GitHub? # to your account

router.navigateByName not routing properly #276

Closed
arethk opened this issue Mar 1, 2021 · 1 comment
Closed

router.navigateByName not routing properly #276

arethk opened this issue Mar 1, 2021 · 1 comment

Comments

@arethk
Copy link

arethk commented Mar 1, 2021

The site I'm working on has a base URL /ops example: https://local.oursite.com/ops/

I create the router like so:

            const resolveOptions = {
                strategy: "ONE",
                hash: false,
                noMatchWarning: false
            };
            const router = new Navigo('/ops', resolveOptions);
            router.on({
                "/": {
                    as: "main",
                    uses: function () {
                        console.log("1");
                        router.navigateByName("login");
                    },
                    hooks: {
                        before: (done) => {
                            done();
                        },
                    },
                },
                "/#": {
                    as: "login",
                    uses: function () {
                        console.log("2");
                        setIt("Page Login");
                    },
                    hooks: {
                        before: (done) => {
                            done();
                        },
                    },
                }
            });
            router.resolve();

When I go to https://local.oursite.com/ops/ with the browser, it redirects me to https://local.oursite.com/ops/ops/# which is incorrect. It should go to https://local.oursite.com/ops/#

krasimir pushed a commit that referenced this issue Mar 4, 2021
@krasimir
Copy link
Owner

krasimir commented Mar 4, 2021

Hey @arethk,

Thanks for reporting. The bug is fixed in 8.9.1 version.

@krasimir krasimir closed this as completed Mar 4, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants