wrangler-legacy
wrangler-legacy copied to clipboard
`wrangler preview --watch` broken with custom build config
🐛 Bug report
Describe the bug
It seems that with a custom build configuration like below, when running wrangler preview --watch
it just exits instead of watching for any changes when the watch_dir
is set to the current directory. It works with other directories, yet putting one file in a directory to make that work seems overkill.
[build]
command = "yarn build"
watch_dir = "."
upload = { format = "service-worker" }
yarn build
: esbuild index.js --bundle --outfile=dist/index.js
Reproduce the bug
A list of steps to reproduce the bug.
- Set up a wrangler project
- Add esbuild to dev dependencies
- Copy the build script above to
package.json
scripts.build
- Add the custom build config to
wrangler.toml
- Run
wrangler preview --watch
Expected behavior
It should just watch for changes instead of exiting with the --watch
flag, yet seems to behave like it would without it.
Environment and versions
Fill out the following information about your environment.
- operating system:
Arch Linux x86_64 (Kernel: 5.13.10-zen1-1-zen)
- output of
wrangler -V
:wrangler 1.19.0
- output of
node -v
:v16.3.0
- content of
wrangler.toml
:
name = "weather"
type = "javascript"
account_id = "x"
workers_dev = true
routes = [
"edge.diced.me/weather*",
"edge.diced.me/weather"
]
zone_id = "x"
[build]
command = "yarn build"
upload = { format = "service-worker" }
@diced - thanks for the report. are you able to use wrangler dev
instead?
Uh no, it errors out with this
And it can't be anything with my code since its not erroring when building
This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.
Thanks for reporting this issue! Wrangler v1 is now deprecated and support is only being provided for critical updates or security concerns. As such, we are closing this issue. New versions of Wrangler are maintained in the workers-sdk repo. If you are running into a similar issue with wrangler v2, please report it in the workers-sdk repo. For more info about wrangler v1 deprecation, please check out our blog post.