frontarm / navi

🧭 Declarative, asynchronous routing for React.
https://frontarm.com/navi/
MIT License
2.07k stars 71 forks source link

canonical urls are wrong if lazy loading is used #189

Open martinloretzzz opened 4 years ago

martinloretzzz commented 4 years ago

I use static rendering with lazy loading, it looks like, that the canonical links in the header are wrong, if the link ends with a "/" (like "/foo/") in the build it will look something like <link rel="canonical" href="https://example.com/foo" />, where the trailing slash is missing. (Results in some seo problems.)

My workaround for now is to remove https://github.com/frontarm/navi/blob/d76b41e6c30ca419ebceb08e4a4c53642fee874e/packages/react-navi/create-react-app.js#L104 and then set the canonical with react helmet.