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

offline-fallback-v2 don't routing to _offline.js page when offline #338

Closed
Dieber opened this issue Apr 5, 2022 · 8 comments
Closed

offline-fallback-v2 don't routing to _offline.js page when offline #338

Dieber opened this issue Apr 5, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@Dieber
Copy link

Dieber commented Apr 5, 2022

Summary

offline-fallback-v2 don't routing to _offline.js page when offline

Versions

  • next-pwa: latest
  • next: ^12.1.0

How To Reproduce

Steps to reproduce the behavior:

  1. clone next-pwa offline-fallback-v2 example
  2. start server, access localhost:3000
  3. Go to DevTools, disable cache, set throtting to offline
  4. refresh

Expected Behaviors

Expect show page which is writing in _offline.js

1649144206(1)

Screenshots

1649144352(1)

@Dieber Dieber added the bug Something isn't working label Apr 5, 2022
@shadowwalker
Copy link
Owner

This is working as expected for me. If you take a look at README instruction, it specifically says yarn build && yarn start instead of yarn dev. Can you try that?

@frinzekt
Copy link

frinzekt commented Apr 6, 2022

I am also experiencing this too... I don't get rerouted to the _offline.js page. I just stick on the current page even after refresh
Screen Shot 2022-04-06 at 3 50 55 pm

@frinzekt
Copy link

frinzekt commented Apr 6, 2022

Relevant issue #328

@Dieber
Copy link
Author

Dieber commented Apr 8, 2022

This is working as expected for me. If you take a look at README instruction, it specifically says yarn build && yarn start instead of yarn dev. Can you try that?

yep, I certenly run the "npm run build" & "npm start" not "npm run dev", which I forgot mention...

@shadowwalker
Copy link
Owner

@Dieber @frinzekt You are visiting the / root path, which can be served by cache. If you take offline, then visit a path like /foobar, it will show the offline page for you. This is what this fallback feature all about. Normally if you build a blog website, user visited a new blog page like /blog/some-new-page, if user is online, he could visit the new blog normally and cache it, but if he is offline, he would be directed to a nice offline page.

@alirezavalizade
Copy link

I have same issue, none of fallback options working. Not offline page and not image fallbacks!

@Dieber
Copy link
Author

Dieber commented Apr 9, 2022

Thanks for your reply, I think your answer is helped me...

@Dieber Dieber closed this as completed Apr 9, 2022
@belkocik
Copy link

same here: got ann error Application error: a client-side exception has occurred (see the browser console for more information). and it doesn't route to _offline.js (if I slide from up to down - refresh a page) then it shows _offline.js page :/ what is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants