Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

page reloads repeatedly when on-demand-entry.js removes static dir #9960

Closed
yosuke-furukawa opened this issue Jan 6, 2020 · 2 comments
Closed

Comments

@yosuke-furukawa
Copy link
Contributor

yosuke-furukawa commented Jan 6, 2020

Bug report

Describe the bug

page reloads repeatedly every 60 seconds.

We are creating amp pages using next.js v9.1.7. we have found some curious behaviour using development mode on next.js. our pages are reloaded repeatedly every 60 seconds.

I would like to listen to next.js opinions.

  1. next.js creates a javascript .next/static/development/pages/index.js when developer visits on top page (/) .
  2. next.js removes static page like .next/static/development/pages/index.js it is not active (last access is 60sec ago) using on-demand-entry.js.
  3. next.js (webpack dev middleware) re-creates the javascript .next/static/development/pages/index.js because watching directory is changed (removed index.js on 2)
  4. amp-dev.js reloads our page because .next/static/development/pages are changed.

so 1-4 situation makes our page reload repeatedly on every 60secs.

I would like to know this is the correct behaviour or not.
I have investigated on-demand-entry.js. I know this webpack middleware removes inactive pages but I don't know why next.js re-creates the inactive pages again. in my humble opinion, it is not necessary to re-create the inactive pages.

And I think 60 seconds is short by default, I would like to change this duration to 600 seconds or longer.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

I have created reproducible repository

next-amp-issue

  1. git clone
  2. run node src/server/index.js
  3. access /
  4. wait 60 secs
  5. reload repeatedly

Expected behavior

pages do not reload when on demand entry.js removes the pages.

Screenshots

N/A

System information

  • OS: macOS
  • Browser (if applies) chrome
  • Version of Next.js: v9.1.7

Additional context

N/A

@Timer Timer added this to the 9.2.x milestone Jan 6, 2020
@yosuke-furukawa
Copy link
Contributor Author

I have understood this behavior is based on "trailing slash". I have investigated and created reproducible repository here.

next-amp-issue

I feel this issue is not next.js issue. If next.js developers have same feelings, I will close this issue.
However, this issue might be a trap for some users. It would be better to write some docs.

@Timer Timer modified the milestones: 9.2.x, 9.2.0 Jan 7, 2020
@Timer Timer modified the milestones: 9.2.0, 9.2.x Jan 14, 2020
@Timer Timer removed this from the 10.x.x milestone Nov 16, 2020
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants