# Next.js with search-ui - browser history bug

**URL:** <https://discuss.elastic.co/t/next-js-with-search-ui-browser-history-bug/263197>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [February 4, 2021, 5:51am UTC](https://discuss.elastic.co/t/next-js-with-search-ui-browser-history-bug/263197 "2021-02-04T05:51:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason-den](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason-den/32/83030_2.png) [@jason-den](https://discuss.elastic.co/u/jason-den)\
**Post date:** [February 4, 2021, 5:51am UTC](https://discuss.elastic.co/t/next-js-with-search-ui-browser-history-bug/263197/1 "2021-02-04T05:51:02Z")

</div>

Hi all.  
I'm using `search-ui` with my `Next.js` project.  
But I found that when I navigate away from the search page to another page using the `Client-side navigations` , I cannot go back by using the browser "back" button (I've only tried chrome.)

Please check the following issue for more detail (demo repo link included).

> <https://github.com/elastic/search-ui/issues/534>
>
> Hi. I'm using \`search-ui\` with my \`Next.js\` project. 
> But I found that when I n…avigate away from the search page to another page using the \`Client-side navigations\`, I cannot go back by using the browser "back" button (I've only tried chrome.)
> 
> \> It seems to be the only lib that support elastic-app-search. Is it correct?
> 
> How to replicate: 
> 1. Run this \[demo repo\]( https://github.com/jason-den/next-search-ui-demo)
> 2. visit search page \`localhost:3001/search\`
> 3. click \`go home page\` at the top of sidebar
> 4. when home page complete rendering, click your browser \`back\` button like this: 
> !\[image\](https://user-images.githubusercontent.com/16683831/104660622-0b490380-571b-11eb-94f0-31f7aa7f3f63.png)
> 
> Problematic result: The URL do change to \`localhost:3001/search?......\` but page remains in home page.
> !\[image\](https://user-images.githubusercontent.com/16683831/104660778-4c411800-571b-11eb-98cf-edd765743092.png)
> 
> 
> I'm not sure this issue come from \`search-ui\`, not from Next.js. I guess this issue has something relate to \`Smart URL\` -- which I want to understand more but couldn't find much documents. 
> 
> \> BTW I also tried \`search-ui\` with \`react router\`, they worked well with each other. 
> 
> Any hint?

---

<div class="post-metadata">

**Author:** ![Brian\_McGue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_mcgue/32/63366_2.png) [@Brian\_McGue](https://discuss.elastic.co/u/Brian_McGue)\
**Post date:** [February 4, 2021, 6:25pm UTC](https://discuss.elastic.co/t/next-js-with-search-ui-browser-history-bug/263197/2 "2021-02-04T18:25:38Z")

</div>

Hi @jason-den!

It looks like another Elastic employee beat me to responding and things are being handled in that issue. Apologies for the delay, thank you for following up here.

Best,  
Brian

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 4, 2021, 6:26pm UTC](https://discuss.elastic.co/t/next-js-with-search-ui-browser-history-bug/263197/3 "2021-03-04T18:26:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
