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

🐛 BUG: Wrangler is updating indefinitely to logs #4482

Closed
nefeleai opened this issue Nov 22, 2023 · 6 comments · Fixed by #4488
Closed

🐛 BUG: Wrangler is updating indefinitely to logs #4482

nefeleai opened this issue Nov 22, 2023 · 6 comments · Fixed by #4488
Labels
bug Something that isn't working

Comments

@nefeleai
Copy link

nefeleai commented Nov 22, 2023

Which Cloudflare product(s) does this pertain to?

Pages

What version(s) of the tool(s) are you using?

3.17.0

What version of Node are you using?

21.2.0

What operating system are you using?

Mac

Describe the Bug

I'm creating a new project with astro following the docs here

running this command

npm create cloudflare@latest my-astro-app -- --framework=astro

After creation i'm running

npm run pages:dev

Preview

https://youtu.be/scxoTM8X07A

The error seems to be related to #4341

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

--- 2023-11-22T00:34:27.059Z debug
🐛 Writing logs to ".wrangler/logs/wrangler-2023-11-22_00-34-26_974.log"
---

--- 2023-11-22T00:34:27.059Z log
Running astro dev...
---

--- 2023-11-22T00:34:27.061Z log
Sleeping 5 seconds to allow proxy process to start before attempting to automatically determine port...
---

--- 2023-11-22T00:34:27.062Z log
To skip, specify the proxy port with --proxy.
---

--- 2023-11-22T00:34:27.638Z log
[proxy]: 02:34:27 AM [@astrojs/cloudflare] 
---

--- 2023-11-22T00:34:27.638Z log
[proxy]: The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice

---

--- 2023-11-22T00:34:32.165Z log
Automatically determined the proxy port to be 4321.
---

--- 2023-11-22T00:34:32.166Z log
No functions. Shimming...
---

--- 2023-11-22T00:34:32.167Z log
 ⛅️ wrangler 3.17.0
�[38;2;255;136;0m-------------------�[39m
---

--- 2023-11-22T00:34:32.215Z warn
�[33m▲ �[43;33m[�[43;30mWARNING�[43;33m]�[0m �[1m--local is no longer required and will be removed in a future version.�[0m

  `wrangler dev` now uses the local Cloudflare Workers runtime by default. 🎉


---

--- 2023-11-22T00:34:32.241Z debug
Retrieving cached values for userId from node_modules/.cache/wrangler
---

--- 2023-11-22T00:34:32.242Z debug
Metrics dispatcher: Posting data {"type":"event","name":"run dev","properties":{"local":true,"usesTypeScript":true}}
---

--- 2023-11-22T00:34:32.250Z log
Using vars defined in .dev.vars
---

--- 2023-11-22T00:34:32.282Z log
[proxy]: 02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log

---

--- 2023-11-22T00:34:32.293Z log
�[2m⎔ Starting local server...�[22m
---

--- 2023-11-22T00:34:32.383Z log
[proxy]: 02:34:32 AM [astro] update /.wrangler/tmp/bundle-Hl9JMj/checked-fetch.js
---

--- 2023-11-22T00:34:32.383Z log
[proxy]: 
02:34:32 AM [astro] update /.wrangler/tmp/bundle-Hl9JMj/middleware-insertion-facade.js
02:34:32 AM [astro] update /.wrangler/tmp/bundle-Hl9JMj/middleware-loader.entry.ts
02:34:32 AM [astro] update /.wrangler/tmp/dev-gDzxUn/pages-shim.js.map

---

--- 2023-11-22T00:34:32.383Z log
[proxy]: 02:34:32 AM [astro] update /.wrangler/tmp/dev-gDzxUn/pages-shim.js

---

--- 2023-11-22T00:34:32.383Z log
[proxy]: 02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log

---

--- 2023-11-22T00:34:32.439Z debug
Metrics dispatcher: Posting data {"type":"event","name":"run pages dev","properties":{}}
---

--- 2023-11-22T00:34:32.484Z log
[proxy]: �[2K
---

--- 2023-11-22T00:34:32.484Z log
[proxy]: �[1G�[1A02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x2)

---

--- 2023-11-22T00:34:32.585Z log
[proxy]: �[2K�[1G�[1A02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x3)

---

--- 2023-11-22T00:34:32.669Z log
[proxy]:   🚀  astro  v3.5.7 started in 5133ms
  
  ┃ Local    http://localhost:4321/
  ┃ Network  use --host to expose
  

---

--- 2023-11-22T00:34:32.681Z log
[proxy]: 02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log

---

--- 2023-11-22T00:34:32.782Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:32.783Z log
[proxy]: 02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x2)

---

--- 2023-11-22T00:34:32.883Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:32.883Z log
[proxy]: �[1A02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x3)

---

--- 2023-11-22T00:34:32.985Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:32.986Z log
[proxy]: �[1A02:34:32 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x4)

---

--- 2023-11-22T00:34:33.085Z log
[proxy]: �[2K�[1G�[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x5)

---

--- 2023-11-22T00:34:33.186Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:33.186Z log
[proxy]: �[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x6)

---

--- 2023-11-22T00:34:33.288Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:33.288Z log
[proxy]: �[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x7)

---

--- 2023-11-22T00:34:33.389Z log
[proxy]: �[2K
---

--- 2023-11-22T00:34:33.389Z log
[proxy]: �[1G�[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x8)

---

--- 2023-11-22T00:34:33.489Z log
[proxy]: �[2K�[1G�[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x9)

---

--- 2023-11-22T00:34:33.590Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:33.590Z log
[proxy]: 02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x10)

---

--- 2023-11-22T00:34:33.691Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:33.692Z log
[proxy]: �[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x11)

---

--- 2023-11-22T00:34:33.791Z log
[proxy]: �[2K
---

--- 2023-11-22T00:34:33.792Z log
[proxy]: �[1G�[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x12)

---

--- 2023-11-22T00:34:33.893Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:33.893Z log
[proxy]: �[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x13)

---

--- 2023-11-22T00:34:33.993Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:33.993Z log
[proxy]: �[1A02:34:33 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x14)

---

--- 2023-11-22T00:34:34.094Z log
[proxy]: �[2K
---

--- 2023-11-22T00:34:34.094Z log
[proxy]: �[1G�[1A02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x15)

---

--- 2023-11-22T00:34:34.195Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:34.195Z log
[proxy]: 02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x16)

---

--- 2023-11-22T00:34:34.298Z log
[proxy]: �[2K�[1G�[1A02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x17)

---

--- 2023-11-22T00:34:34.396Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:34.396Z log
[proxy]: �[1A02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x18)

---

--- 2023-11-22T00:34:34.499Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:34.499Z log
[proxy]: 02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x19)

---

--- 2023-11-22T00:34:34.597Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:34.598Z log
[proxy]: 02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x20)

---

--- 2023-11-22T00:34:34.697Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:34.697Z log
[proxy]: 02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x21)

---

--- 2023-11-22T00:34:34.798Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:34.798Z log
[proxy]: 02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x22)

---

--- 2023-11-22T00:34:34.899Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:34.899Z log
[proxy]: 02:34:34 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x23)

---

--- 2023-11-22T00:34:35.001Z log
[proxy]: �[2K
---

--- 2023-11-22T00:34:35.001Z log
[proxy]: �[1G�[1A02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x24)

---

--- 2023-11-22T00:34:35.101Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:35.102Z log
[proxy]: 02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x25)

---

--- 2023-11-22T00:34:35.202Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:35.202Z log
[proxy]: �[1A02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x26)

---

--- 2023-11-22T00:34:35.302Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:35.302Z log
[proxy]: �[1A02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x27)

---

--- 2023-11-22T00:34:35.402Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:35.403Z log
[proxy]: 02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x28)

---

--- 2023-11-22T00:34:35.504Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:35.504Z log
[proxy]: 02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x29)

---

--- 2023-11-22T00:34:35.604Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:35.605Z log
[proxy]: �[1A02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x30)

---

--- 2023-11-22T00:34:35.705Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:35.706Z log
[proxy]: 02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x31)

---

--- 2023-11-22T00:34:35.806Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:35.807Z log
[proxy]: �[1A02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x32)

---

--- 2023-11-22T00:34:35.908Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:35.908Z log
[proxy]: �[1A02:34:35 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x33)

---

--- 2023-11-22T00:34:36.009Z log
[proxy]: �[2K�[1G�[1A
---

--- 2023-11-22T00:34:36.010Z log
[proxy]: 02:34:36 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x34)

---

--- 2023-11-22T00:34:36.110Z log
[proxy]: �[2K�[1G
---

--- 2023-11-22T00:34:36.111Z log
[proxy]: �[1A02:34:36 AM [astro] update /.wrangler/logs/wrangler-2023-11-22_00-34-26_974.log (x35)

---
@nefeleai nefeleai added the bug Something that isn't working label Nov 22, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 22, 2023
@nefeleai nefeleai changed the title 🐛 BUG: Wrangler it updating indefinitely to logs 🐛 BUG: Wrangler is updating indefinitely to logs Nov 22, 2023
RamIdeas added a commit that referenced this issue Nov 22, 2023
instead of project root .wrangler
frameworks may be watching the project root .wrangler dir for changes
causing an infinite loop of update logs
e.g. #4482
@RamIdeas
Copy link
Contributor

Hi @nefeleai! Thanks for reporting this.

It looks like Astro is watching the whole .wrangler directory for changes which is unfortunately causing an infinite loop of update logs being written to the file causing more update logs

We might have to pick a different directory if this assumption is more widespread than just Astro. We can revisit using project root .wrangler directory in the future if the usage of this directory is clarified

@penalosa
Copy link
Contributor

@nefeleai To use Wrangler with Astro, you'll need to configure Astro to ignore the .wrangler directory. As well as adding .wrangler to your .gitignore, you'll need to add the following to your Astro config file (from withastro/astro#4325 (comment)):

vite: {
  server: {
    watch: {
      ignored: ['**/.wrangler/**']
    }
  }
}

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Nov 22, 2023
@penalosa
Copy link
Contributor

Re-opening because C3 should really add that config automatically (cc @dario-piotrowicz @jculvey )

@penalosa penalosa reopened this Nov 22, 2023
@github-project-automation github-project-automation bot moved this from Done to Untriaged in workers-sdk Nov 22, 2023
@RamIdeas RamIdeas mentioned this issue Nov 22, 2023
6 tasks
RamIdeas added a commit that referenced this issue Nov 22, 2023
* rename debug-log-file to reflect non-debug-only behaviour

* change default log directory to global config dir
instead of project root .wrangler
frameworks may be watching the project root .wrangler dir for changes
causing an infinite loop of update logs
e.g. #4482

* only print log file location if seen error message

+ update log emoji to 🪵 instead of 🐛
since it's not just a debug log file anymore

* print absolute log file path
since it's now in the home directory, no longer near the cwd

* use console.warn instead of logger.warn
so not to have include the *very* visible bright-yellow [WARNING] indicator
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Nov 22, 2023
@penalosa penalosa reopened this Mar 19, 2024
@github-project-automation github-project-automation bot moved this from Done to Untriaged in workers-sdk Mar 19, 2024
@dario-piotrowicz
Copy link
Member

@penalosa why was this reopened, I guess this is still an issue?

@jculvey
Copy link
Contributor

jculvey commented Apr 9, 2024

@penalosa why was this reopened, I guess this is still an issue?

+1 to what Dario said, this issue seems to have been resolved with the recent rework of dev commands in full-stack templates. pages:dev is no longer added as a package script, and running npm run dev on a fresh Astro app seems to run with clean output for me.

@penalosa
Copy link
Contributor

penalosa commented Apr 9, 2024

This was reopened since it was erroneously closed by an unrelated commit. If it's been fixed in general in C3 happy to close again.

@penalosa penalosa closed this as completed Apr 9, 2024
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants