workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: `wrangler dev` is not auto-reloading a custom build when files change

Open ajwootto opened this issue 2 years ago • 1 comments

What version of Wrangler are you using?

2.0.23

What operating system are you using?

Mac

Describe the Bug

I have a wrangler.toml file that looks like the following

name = "js"
account_id = "<redacted>"
workers_dev = true

main="./dist/main.js"

[build]
command = 'yarn build'

The yarn build just runs webpack.

When I run the worker using wrangler dev (tried in both local and not-local mode) then the build command is run the first time and the server starts up, but any changes to my local source files do not trigger a rebuild of the worker.

I have also tried configuring the [build] settings like this:

[build]
command = 'yarn build'
cwd = './'
watch_dir = './'

which also does not work. Is there something I'm configuring wrong, or is the functionality broken in some way?

ajwootto avatar Jul 27 '22 18:07 ajwootto

This should definitely work. What is the layout of your source files? Would you be able to set up a small reproduction of the problem to share with us?

petebacondarwin avatar Jul 28 '22 05:07 petebacondarwin

Closing as inactive/needs reproduction

rozenmd avatar Sep 15 '22 14:09 rozenmd