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

nextjs HMR always reload index page #73

Closed
acanimal opened this issue Jul 11, 2017 · 5 comments
Closed

nextjs HMR always reload index page #73

acanimal opened this issue Jul 11, 2017 · 5 comments

Comments

@acanimal
Copy link

From what I have experienced, since version 1.0.40 it seems nextjs always reloads the index page.

@acanimal acanimal changed the title next HMR always reload page nextjs HMR always reload page Jul 11, 2017
@acanimal acanimal changed the title nextjs HMR always reload page nextjs HMR always reload indexpage Jul 11, 2017
@acanimal acanimal changed the title nextjs HMR always reload indexpage nextjs HMR always reload index page Jul 11, 2017
@fridays
Copy link
Owner

fridays commented Jul 11, 2017

Could you share a sample to reproduce the issue?

@acanimal
Copy link
Author

acanimal commented Jul 12, 2017

In development the nextjs app checks for code updates invoking /_next/on-demand-entries-ping?page=/ which results in a message like Client pings, but there's no entry for page: on server side and produces the whole app will be loaded.

I think it has something to do with this https://github.com/fridays/next-routes/blob/master/src/index.js#L125

Looking in the file history the problem is introduced in this commit 1afd1dd. Using again the this.page = page.replace(/^\/?(.*)/, '/$1') line seems to fix the problem and now the nextjs HTML tries to refresh content calling /_next/on-demand-entries-ping?page=/index instead not existent /_next/on-demand-entries-ping?page=/

@fridays
Copy link
Owner

fridays commented Jul 12, 2017

The URL is correct actually (try without next-routes). I can't see any issues, please share some code to reproduce it.

@acanimal
Copy link
Author

Maybe is due this fix you done in last release of nextjs: vercel/next.js#2505
We have a previous version. I'll try to update and check.

@fridays
Copy link
Owner

fridays commented Jul 24, 2017

Is it solved?

@fridays fridays closed this as completed Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants