Is the concept containers only for local/isolated tasks that can be executed by a worker. As I've b

Is the concept containers only for local/isolated tasks that can be executed by a worker.
As I've been struggling to get a simple container to run which can handle requests to call external sites with fetch requests or Playwright.
Issues like:
  • Singletons objects in worker are not scoped to code that runs in container, its obv to say but not obv in code what is scoped.
  • Contains can't do network requests? (
    ✘ [ERROR] Error: [unenv] https.request is not implemented yet!
    )
  • Not sure why examples/templates as for hono app vs the worker request class, I was initially treating index.ts as the entry to Docker
  • The way of getting a container seems odd, following the example of using getRandom always throws an error first:
    ✘ [ERROR] Error checking if container is ready: connect(): Connection refused: container port not found. Make sure you exposed the port in your container definition.
    ✘ [ERROR] Error checking if container is ready: The operation was aborted
    Container exited with unexpected exit code: 1 {"exitCode":1,"name":"Error","stack":"Error: Container exited with unexpected exit code: 1"}
    [wrangler:info] POST / 500 Internal Server Error (2153ms)
    ✘ [ERROR] Error: [unenv] https.request is not implemented yet!
Was this page helpful?