-
Notifications
You must be signed in to change notification settings - Fork 334
[dev] request for feedback #1047
Comments
On change, dev enters a never-ending rebuild cycle (issue #1078) |
Worker updates not seen in terminal until restarting dev (issue #1082) |
I just stumbled into this. Doing a |
On change, cloudflared tunnel breaks (issue #1107) |
The watcher seems to be really slow, I guess it's timeout based and not on filesystem changes? Edit: Also it seems like it's not actually picking up changes. Testing with |
I'd just like to add that this is a really awesome feature. It was terrible trying to develop without feedback before. |
Hey y'all - I'm back from vacation so responses here should be a bit more frequent.
@deini do you mind filing an issue with steps to reproduce? We definitely want to support every imaginable type of HTTP request and that is 100% a bug.
@maggo my guess is that it's not really the watcher that is slow, but rather the fact that Wrangler is required to re-build and re-upload your script on every change. We have some tentative plans to address performance but for now what we probably want to do is actually explain what Wrangler is doing and when - the output is a bit cluttered right now.
This is troubling - would you mind filing an issue with steps to reproduce? @ackerleytng Thanks so much for the kind words, always looking for ways to make your experience better 😄 |
This isn't a reproduction yet, but especially early on, wanted to give you information on a crash! Version 1.8.0 crashes with a listener bind error:
run cmd:
response:
|
Hey @defjosiah - that error message could definitely be a bit clearer but the important bit is I'm not sure what OS you're on - there are a few ways of finding out which process is listening on a specific port, but I think if you find and kill that process it should work. Let me know! If not and you have more details you can share - please file a separate issue 😄 |
@EverlastingBugstopper that definitely fixed it. I had killed the process running on that port before starting wrangler, but with further investigation, it looks like the process I killed kept restarting itself 😆 |
Is there a simple way to detect in the code, when the work is running locally in dev mode? |
Hey @NicholasHazen - not necessarily. The best way to do it is probably to set up environments with environment variables. For instance, your workers_dev = true
type = "javascript"
account_id = "12657839048768728910"
vars = {
MODE = "development",
}
[env.prod]
routes = ["example.com/*"]
zone_id = "1768940583781982"
vars = {
MODE = "production",
} Then, when you ran When you went to publish, you could run Hope this helps! |
That seems perfectly reasonable to me, thanks for the quick feedback. |
Hi, I need to access the original host of the request to the dev server, as the request is handled based on the subdomain. Currently I can't do that wrangler dev is rewriting it to It would be great if there was a flag to not rewrite the host. This worker only provides synthetic requests from a different backend, so what the host backend is set to doesn't need to be accessible from the worker. Alternatively if the original host was passed through as a header that could work. Is anything like that possible at the moment? |
Separately - I'm trying to setup the untested flow of making a request to the dev worker, which snakes its way back to localhost via a trycloudflare tunnel (or a tunnel on a custom hostname). I can't seem to get it to work. The tunnel works fine directly, but the worker reports a 502 when trying to access it. Edit: This actually seems to be the case for any host I set - do subrequests just not work from the dev worker? |
@bigelowcc I managed to do subrequests from the worker, at least |
@bigelowcc - I'm not sure exactly what you mean, unfortunately there's currently no way to pass in a host header. But you can pass a subdomain as part of the As for trying to set up the localhost routing, you can check out this template by @GregBrimble which should take care of everything until we get this functionality actually introduced to Wrangler. |
This comment has been minimized.
This comment has been minimized.
Is there a workaround for using Node.js The following command doesn't work: NODE_OPTIONS="--inspect" wrangler dev The above command fails with this error message:
Note: I used |
Hey @aleclarson - glad you got the first question resolved. Going to hide it for now since it is not on topic (this issue is specifically for As for the second question, Cloudflare Workers are not executed within the context of a Node runtime, and Wrangler is a completely separate tool from Node written in Rust. You can use That being said, we do have some plans to implement |
@EverlastingBugstopper Good to know, thanks! Do you think Cloudflare would consider maintaining an "environment polyfill" that would make a NodeJS environment behave like a Cloudflare Worker environment? That would allow me to use the NodeJS debugger. :) |
When using a custom I'm using inline source maps via edit: Oh, found this: cloudflare/workers-sdk#1315 |
I've been using it since yesterday and so far the only problem is using Another nitpick, there is no |
This is an enormous improvement to my workflow. 🎉 Here's my extremely hot take on the first 10 minutes:
|
Thanks so much for saying so! Really glad we can help out 😄
unfortunately there isn't a straightforward way to show the entire object in the console.log output because the Chrome Devtools Protocol is typically interactive. If you open the inspector with
Could you file a more detailed bug report on this in a separate issue? I'm not able to reproduce
So glad to hear it! Thanks for the feedback, it's really appreciated 😄
Yes, we'd love to solve this with #901 but it is not a high priority for our team right now. One of our community members/resident power users @GregBrimble has set up an automated example for you that may bridge the gap for now. Like I said, eventually we'd like to integrate this directly.
KV should work, but note that right now we do not use a separate namespace for your values unless you are using Workers Sites, this should be fixed with #1032 and is a blocker on getting this feature out of alpha. Additionally we are working on making the overall experience more realistic by adding support for things like the cache api etc. by running the code directly on our edge (right now it runs in GCS). For now, all of the same restrictions that applied to
Really really glad to hear this, our goal here was to get something into your hands, even if it's not quite perfect yet. Incremental improvement over perfectionism 😄 |
Oh! @aleclarson I missed your comments, my apologies.
Unfortunately not any time soon. The Cloudflare Workers Runtime is a proprietary, closed-source implementation of the Service Workers API and it's not portable. We have some ideas around how to improve the local testing experience but making it run in Node is not on the list.
There are some ideas around how to get this working and we are hashing that out internally - it will likely require some changes to the runtime for this to work smoothly. No timeline on when exactly it will be supported but it is on our radar |
Would love the possibility to be able to fetch from local IP ranges. |
TLDR:
I am developing a Graphql server building upon https://github.com/signalnerve/workers-graphql-server Using the base template with If I do Locally though I keep getting redirected to example.com. No errors either although I guess there are errors swallowed by wrangler dev. There is something it does not like, but I cannot figure out what it is. Any clues? |
hey @ecerroni - so what you're running into is probably due to the fact that @GregBrimble has an unofficial template for setting something this up here, but the gist of it is that it uses cloudflared to create a public endpoint for the service running locally on your computer. It will then give you a public endpoint, and you can pass that hostname to |
@EverlastingBugstopper Thank you. It seems straight forward. However, I tried it and it is not working for me. Maybe I am missing something obvious. First I start the tunnel
Then I start wrangler dev with the public endpoint as the host
This is the screen I see when I try to access |
Going through the thread I couldn't see if it was already mentioned before but while the request.header.get('Accept-Encoding'); The output in the On another note it seems that there will be a |
this won't work because you're exposing perhaps i'm misunderstanding what you're trying to do - could you open a new issue and list out steps to reproduce the issue you're having (especially helpful if you can link a repository i can check out and futz around with) @autarc - could you file a new issue for the request header thing you're seeing and we'll take a look? as for the |
Sure created it here: #1425 Also thanks for clarifying the |
Trying recreating the issue from scratch using a different remote schema I realized that the culprit is in the json file I am trying to require and pass in the remoteExecutableSchema. If the file is small there is no problem. At this point I am confused and I do not know if it is either me doing something wrong in the code or it is the graphql's makeRemoteExecutableSchema having issues with larger files or I cannot load large local json files (under |
🤔 - hmmmm.... unfortunately, i have no clue what your issue is from reading this. if you could link a repository in a new issue with detailed steps to reproduce, i'll be more than happy to take a look. for now, logging off for the long weekend here in the US! |
Sure, enjoy your weekend :) In the meantime, I created an issue here with a reproducing repo |
There are at least two node instances, so I found that making the inspector use a random port with Edit: and as mentioned later: " |
ack, I've subscribed to it, thanks! |
@EverlastingBugstopper is it possible to automatically set some environment variables when using |
@mskd12 you can set up different environments and create vars for each environment. See the docs: https://developers.cloudflare.com/workers/tooling/wrangler/environments/ |
@PierBover I did check it, but I was not sure about the interaction between environments and |
@mskd12 - no, environments work the same exact way they do for any other command. if you dont specify an |
Would be nice to be able to define a port in |
I think you need to pass the port using the --port flag (#1477 made it so that it can also be set in wrangler.toml). |
@SupremeTechnopriest there are two things going on here
|
@EverlastingBugstopper So even though I'm running |
Yup, running on Cloudflare's servers |
@EverlastingBugstopper Thanks for the info! Makes sense now. |
As Thanks to everyone who gave us feedback over the past few months! |
wrangler dev
is now in alpha! If you're using it, we want to hear from you. What do you like about it, what do you think should change, have you found issues with it? Comment below!It's possible that your feedback deserves a new issue entirely. If you're filing a new issue, please start the title with
[dev]
, mention me with @EverlastingBugstopper, and add a link to the issue in this issue.Current issues in the milestone can be found here.
The text was updated successfully, but these errors were encountered: