question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Hot Reload not working with Cloudflare Pages

See original GitHub issue

What version of Remix are you using?

^1.1.1

What version of Node are you using? Minimum supported version is 14.

v17.0.1

Steps to Reproduce

npx create-remix@latest
# choose Cloudflare Pages
cd [whatever you named the project]
npm run dev
  • Edit the file app/routes/index.jsx
  • Observe the File changed log in your console as well as the related logs
  • Observe that http://127.0.0.1:8788/ has not changed
  • Refresh the page
  • Observe that http://127.0.0.1:8788/ has not changed
  • Ctrl+C to stop the npm script
  • run npm run dev again
  • Observe that the edit to app/routes/index.jsx is now present
  • edit the file again
  • observe that the change are still not present

Expected Behavior

We’d expect the changes to be immediately apparent

Actual Behavior

The changes are not visible until the process has be stopped and restarted using the npm run dev command

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:22
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tulup-connercommented, Jun 8, 2022

For me, the browser needs to refresh twice in order to see updates.

So each hot reload shows the second-most-recent update, not the one I just made.

This is pretty annoying for my workflow. 😦

"@remix-run/cloudflare": "^1.5.1",
"@remix-run/cloudflare-pages": "1.5.1",
"@remix-run/dev": "^1.5.1",
"@remix-run/react": "1.5.1",
"wrangler": "^beta"

I started another project with Remix + Cloudflare Pages about 8 weeks ago and I remember noticing that one of the version upgrades I made caused this to start happening. I don’t really know enough about what’s going on to say if this might be an issue with wrangler also/instead.

Edit:

I have an app with the following versions where the live reload works:

"@remix-run/cloudflare-pages": "^1.1.3",
"@remix-run/dev": "^1.1.3",
"@remix-run/react": "^1.1.3",
"@remix-run/serve": "^1.1.3",
"wrangler": "^0.0.16"
1reaction
drewdecarmecommented, Jan 3, 2022

If you haven’t seen it, checkout this comment where you can now install wangler@pages and hot reloading should work. It doesn’t seem like other attached issues have been updated… but for now, installing the pages package enables hot reloading for me.

I believe the create-remix CLI has the wrangler package set at alpha… so just update it to pages and things should start working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues · Cloudflare Pages docs
Known issues. Here are some known bugs and issues with Cloudflare Pages: ​​ Builds and deployment. GitHub and GitLab are currently the only ......
Read more >
New updates 1.1.6 has a bug (Continuously Refresh Webpages)
Any page I visit on my website it reloads continuously and don't stop reload. ... latest wordpress… running cloudflare plugin cause unstopable refresh…...
Read more >
Running a Next.js Site on Cloudflare Pages - Opstrace
Error : Image Optimization using Next.js' default loader is not compatible with `next export`. Possible solutions: - Use `next start` ...
Read more >
Newest 'cloudflare-pages' Questions - Stack Overflow
I am trying to read a KV from React App, but it won't work I've created a binding and if I try env.Name,...
Read more >
Fix Cloudflare Remix HMR Bug with patch-package - Justin Noel
This means Hot Module Reloading(HMR) doesn't work at all. So, it's a pretty painful developer experience having to stop and restart the dev ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found