Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[dev] On change, dev enters never-ending rebuild cycle #1078

Closed
jaymakes11 opened this issue Feb 17, 2020 · 7 comments
Closed

[dev] On change, dev enters never-ending rebuild cycle #1078

jaymakes11 opened this issue Feb 17, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@jaymakes11
Copy link

@EverlastingBugstopper

🐛 Bug Report

Environment

  • operating system: MacOS (Catalina, 10.15.1)
  • output of rustc -V: n/a
  • output of node -v: v10.17.0
  • output of wrangler -V: 1.8.0-rc.0

Steps to reproduce

Start workers dev (wrangler dev). Save the workers' entry file (e.g. index.js).

What did you expect to see?

The worker should rebuild once and then dev should be in watch mode.

What did you see instead?

The worker rebuilds once, then again, and agin, etc... never ending.

Saving a worker's file results in a never-ending loop:

image

Notes (maybe relevant):

  • This is for a workers site
  • (Most of the time) console.logs are not showing in the terminal when the worker is called (i.e. when refreshing the page viewing the local worker's site). Can create a separate issue for this if need be.
@xtuc
Copy link
Member

xtuc commented Feb 17, 2020

Could you please share your wrangler configuration (please remove zone/account info)? and webpack if you are using it?

@jaymakes11
Copy link
Author

Sure thing:

wrangler.toml

name = "dev"
type = "webpack"
# account_id = [removed for privacy]
workers_dev = true

[site]
bucket = "./dist"
entry-point = "./workers-site"

[env.production]
name = "production"
route = "www.my-domain.com/*" # changed for privacy
# zone_id = [removed for privacy]

Also, I've just tested on a non Workers Sites worker and am not seeing this problem.

@EverlastingBugstopper
Copy link
Contributor

Hmm... Wrangler might have some issues with bucket = "./dist" because that's the folder that webpack writes the worker out to. My guess is that when the build is kicked off, it writes to ./dist which is the bucket, so Wrangler says "oh the files in the site have changed, let's rebuild" and then when it does that it writes to ./dist... and so on and so forth.

My recommendation for now is to rename the directory you have your static assets in and we will likely solve this along with #1046

@jaymakes11
Copy link
Author

jaymakes11 commented Feb 18, 2020

My recommendation for now is to rename the directory you have your static assets in and we will likely solve this along with #1046

Your guess was right, @EverlastingBugstopper. This did the trick. Thank you :)

I've also noticed that I have to restart dev for changes to be picked up, suggesting a caching issue (either in my settings or dev itself). Anything obvious I may be missing here? Would it be helpful for me to open an issue for this?

@EverlastingBugstopper
Copy link
Contributor

That is interesting - the cache api itself won't be doing anything because it's not enabled (yet™️) with wrangler dev, but your browser may be caching something? might need to do a hard refresh (cmd + shift + r on your mac)

@EverlastingBugstopper
Copy link
Contributor

if that doesn't work then yes i'd file a new issue

@doublemarked
Copy link

This is annoying, and having to reconfigure all my projects to not use the standard dist/ build output to combat a wrangler bug is doubly annoying.

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

No branches or pull requests

4 participants