PANE

Next.js code reruns unexpectedly after browser navigation

11 posts since Oct 2022, all from GitHub.

“Link to the code that reproduces this issue https://github.com/amannn/nextjs bug repro usepathnamessg/commit/c6b084df43e08a9b043548fb577be8db5f059bde To Reproduce Compare the output of usePathname in development vs during the static prerender when accessing the route /test which…”
GitHub
“Link to the code that reproduces this issue Codesandbox solution To Reproduce 1. Introduce layout that uses localFont 2. Set Access Control Allow Origin header and set an origin where you are trying to render your nextjs app (https://codesandbox.io/p/devbox/hungry tharp…”
GitHub
“Link to the code that reproduces this issue or a replay of the bug https://github.com/leo cheron/nextjs issue dynamic To Reproduce Dynamically multiple server of client components from a server page / component: Where ServerComponentA & B will import respectively…”
GitHub

Developers are experiencing issues where Next.js getServerSideProps or layout components re-execute unnecessarily when navigating between pages using the browser's forward and back buttons, or even with Link components. This leads to performance problems and unexpected behavior, particularly in production builds or static exports.

devtoolsperformancenextjsreactjavascript
FIT
0%
SIGNAL
77%
SOURCES11
FRESHEST POSTNOV 2024
TRACKED SINCE49D AGO

SOURCES (11)

“Link to the code that reproduces this issue https://github.com/amannn/nextjs bug repro usepathnamessg/commit/c6b084df43e08a9b043548fb577be8db5f059bde To Reproduce Compare the output of usePathname in development vs during the static prerender when accessing the route /test which uses a rewrite in the middleware. Current vs. Expected behavior usePathname seems to…”

GITHUBNov 2024

“Link to the code that reproduces this issue https://github.com/samselikoff/stale link updates in dev To Reproduce 1. Start the application in development ( npm run dev ) 2. Quickly click Link 1, Link 2, then Link 3 3. You'll see the UI update with all three navigations – it will show "Post 1", "Post 2" and "Post3" Current vs. Expected behavior Current: The UI updates with all link navigations, including stale ones. Expected: The UI should discard stale link navigations, and only render the lates”

GITHUBOct 2024

“Link to the code that reproduces this issue https://github.com/rick liruixin/next getServerSideProps bug demo To Reproduce Page: categories/[...url].tsx When navigating from https://www.alexandermcqueen.cn/categories/women/ready to wear.html to https://www.alexandermcqueen.cn/categories/women.html, and then to https://www.alexandermcqueen.cn/categories/women/shoes.html, Clicking the browser's forward and backward buttons to move between these pages sometimes causes getServerSideProps not to trig”

GITHUBJul 2024

“Link to the code that reproduces this issue https://github.com/jlhervy/test app nextjs/ To Reproduce Start the application in development, clic the navigation buttons to the left, and notice that the root layout does not rerender. Now, produce a static export, or a production build, serve the static files (nginx, python m http.server) or run next start, and clic the navigation buttons. This time, we can see that the root layout rerenders on each navigation (the console.log triggers), even though”

GITHUBApr 2024

“Link to the code that reproduces this issue https://github.com/zoom2009/nextjs layout rerender To Reproduce Develop case (Working fine) 1. yarn dev 2. open inspect and press info or home to see a log Production case (bug by call useEffect every route navigate) 1. yarn build 2. yarn start 3. open inspect and press info or home to see a log Current vs. Expected behavior Current after build useEffect call every route navigate that make my layout re render every time how can I shallow it? Expect lik”

GITHUBMar 2024

“Link to the code that reproduces this issue Codesandbox solution To Reproduce 1. Introduce layout that uses localFont 2. Set Access Control Allow Origin header and set an origin where you are trying to render your nextjs app (https://codesandbox.io/p/devbox/hungry tharp y47qpv?file=%2Fnext.config.js%3A6%2C8) 3. Apply font family style (https://codesandbox.io/p/devbox/hungry tharp y47qpv?file=%2Fpages%2F%5B%5B...path%5D%5D.tsx%3A15%2C7) 4. Start app using "next build" && "next start" 5. Render a”

GITHUBDec 2023

“Link to the code that reproduces this issue https://github.com/textsurf/tune.land/tree/7900104fe0932ce8780b0c26985f95b6a492d97b To Reproduce Have an app which loads stylesheets like this: Add this to app.tsx : Current vs. Expected behavior Current behavior Current behavior is for the remote import to be injected in the middle of the file, after the contents of foo.css , so you get this error message in the Chrome dev inspector: Define @import rules at the top of the stylesheet <br/ An @import ru”

GITHUBDec 2023

“Link to the code that reproduces this issue or a replay of the bug https://github.com/leo cheron/nextjs issue dynamic To Reproduce Dynamically multiple server of client components from a server page / component: Where ServerComponentA & B will import respectively ClientComponentA & ClientComponentB like below: ClientComponentA being just a large SVG: Current vs. Expected behavior According to the documentation, If you dynamically import a Server Component, only the Client Components that are chi”

GITHUBSep 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router, Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue or a replay of the bug https://github.com/jk1x8/App router issue To Reproduce 1. Clone the repo https://github.com/jk1x8/App router issue 2. After installing dependencies run npm run build and npm start”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Image optimization (next/image, next/legacy/image) Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/next 878 iyl8kd?file=%2Fpages%2Findex.js To Reproduce Providing non integer width or height prop to Image component will always result in this warning: Describe the Bug Expected Beh”

GITHUBMar 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: linux Arch: x64 Version: 58 Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.19 pnpm: 7.13.0 Relevant packages: next: 14.2.0 canary.21 eslint config next: 14.1.3 react: 18.2.0 react dom: 18.2.0 What browser are you using? (if relevant) Chrome 106.0.5249.119 How are you deploying your application? (if rele”

GITHUBOct 2022

SOLUTION LANDSCAPE

Brought to you byTop Sectors

A Player feature.See how many ways this pain can be solved, who's already building, and where the gaps are.

Related panes

/ same corner of the problem