You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...allows you to run a Worker, but then at runtime, try wrangler dev --remote and you'll see the following runtime error:
[wrangler:inf] GET /favicon.ico 500 Internal Server Error (51ms)
✘ [ERROR] Uncaught (in response) TypeError: Cannot read properties of undefined (reading 'fetch')
at PuppeteerWorkers.launch
(file:///Users/brendan/src/test/browser-rendering-remote/.wrangler/tmp/dev-na2A11/index.js:16857:32)
at Object.fetch
(file:///Users/brendan/src/test/browser-rendering-remote/.wrangler/tmp/dev-na2A11/index.js:18456:56)
at fetchDispatcher
(file:///Users/brendan/src/test/browser-rendering-remote/.wrangler/tmp/dev-na2A11/index.js:18554:19)
at __facade_invokeChain__
(file:///Users/brendan/src/test/browser-rendering-remote/.wrangler/tmp/dev-na2A11/index.js:18516:10)
The browser property above is interpreted as a part of [observability] — even though [observability] has no such property that one can configure.
The browser binding is not defined at runtime, leading to the runtime error.
This is likely to happen a lot because the C3 template we give you back uses []:
so if you drop browser = { binding = "MYBROWSER" } (or similar) under this, then you'll hit some flavor of this issue. And it looks like things are breaking at runtime, which is horribly misleading.
We should consider starting to loudly raise a warning (not error) in local dev if we see properties within wrangler.toml that we know are not supported as part of the given binding/thing being configured. Ex: if I see that the observability binding has a browser property configured — we should know that that....isn't a thing and warn you — right?
We should likely audit docs for other examples of places where we can do (1)
In the Browser Rendering puppeteer fork, we should be able to check if the binding was actually passed in — and if not, throw a loud and clear error that explains
@lrapoport-cf recognize one answer to this is — wrangler.json
We also have lot of people using TOML.
If I understand root cause right — seems like there should be a way to validate / warn about fields that we see in TOML config that aren't actually part of that thing? So that we can give people better guidance?
irvinebroque
changed the title
🐛 BUG: TOML not validated before running Worker
🐛 BUG: TOML not validated before running Worker + bad Browser Rendering API error
Dec 12, 2024
Which Cloudflare product(s) does this pertain to?
Wrangler
What version(s) of the tool(s) are you using?
3.95.0
What version of Node are you using?
22.3.0
What operating system and version are you using?
Sequoia 15.1.1
Describe the Bug
This TOML:
...allows you to run a Worker, but then at runtime, try
wrangler dev --remote
and you'll see the following runtime error:The
browser
property above is interpreted as a part of[observability]
— even though[observability]
has no such property that one can configure.The browser binding is not defined at runtime, leading to the runtime error.
This is likely to happen a lot because the C3 template we give you back uses
[]
:workers-sdk/packages/create-cloudflare/templates-experimental/remix/templates/wrangler.toml
Lines 9 to 11 in 0117820
so if you drop
browser = { binding = "MYBROWSER" }
(or similar) under this, then you'll hit some flavor of this issue. And it looks like things are breaking at runtime, which is horribly misleading.What do we need to do?
wrangler.toml
that we know are not supported as part of the given binding/thing being configured. Ex: if I see that the observability binding has abrowser
property configured — we should know that that....isn't a thing and warn you — right?Please provide a link to a minimal reproduction
https://github.com/irvinebroque/browser-rendering-remote
h/t @rita3ko finding this
The text was updated successfully, but these errors were encountered: