Love the idea of that method - makes my code really nicer.
Now - to use it i need to:
import { getBindingsProxy } from "wrangler";
this for sure results in an "cannot find package wrangler"
so i move wrangler from dev dependencies to dependencies.
after restart, it than complains that it wants to load the full wrangler inside of wranger - resulting in nodejs errors like:
X [ERROR] Could not resolve "fs/promises"
../../node_modules/.pnpm/miniflare@3.20240129.0/node_modules/miniflare/dist/src/index.js:2506:30:
2506 │ var import_promises = require("fs/promises");
╵ ~~~
The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
X [ERROR] Could not resolve "worker_threads"
../../node_modules/.pnpm/miniflare@3.20240129.0/node_modules/miniflare/dist/src/index.js:5159:36:
5159 │ var import_worker_threads = require("worker_threads");
╵ ~~~~~~
The package "worker_threads" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
as for sure, these APIs are not available when loaded inside of wrangler.
So, how to solve this?