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

SST Support #248

Open
austinm911 opened this issue Sep 10, 2024 · 3 comments
Open

SST Support #248

austinm911 opened this issue Sep 10, 2024 · 3 comments

Comments

@austinm911
Copy link

I'm running hono on a cloudflare worker using SST in a monorepo. Any guidance here?

@keturiosakys
Copy link
Member

Hey @austinm911, thanks for checking us out! I'm gonna try to figure out SST support live :D here's my simple model repo: https://github.com/keturiosakys/cloudflare-hono-sst

In theory it should work without any extra modifications. You simply need to import the instrument function, wrap your exported app object from Hono, and run npx sst dev.

However, looks like SST doesn't like the Node.js dependencies our client library depends on as I've gotten the error below. The nodejs_compat flag is enabled in wrangler.toml but I'm not sure why SST is ignoring that... will keep you posted!

node:http error:

|  Error       Hono sst:cloudflare:Worker → HonoScript cloudflare:index:WorkerScript
|    sdk-v2/provider2.go:385: sdk.helper_schema: error creating worker script: Uncaught Error: No such module "node:http".
  imported from "worker.mjs"
 (10021): [email protected]
|  Error       Hono sst:cloudflare:Worker → HonoScript cloudflare:index:WorkerScript
|  Error: No such module "node:http".
|  imported from "worker.mjs"
|  (10021)

✕  Failed
   Hono sst:cloudflare:Worker → HonoScript cloudflare:index:WorkerScript
     sdk-v2/provider2.go:385: sdk.helper_schema: error creating worker script: Uncaught Error: No such module "node:http".
  imported from "worker.mjs"
 (10021): [email protected]
   Hono sst:cloudflare:Worker → HonoScript cloudflare:index:WorkerScript
   Error: No such module "node:http".
   imported from "worker.mjs"
   (10021)

@austinm911
Copy link
Author

@keturiosakys it might be a similar issue to sst/sst#4677. I tried adding the esbuild options suggested and wasn't able to get it working.

Also, probably worth noting I don't see SST projects use a wrangler/dev.vars file since everything is configured in the sst.config.ts file https://github.com/sst/ion/tree/dev/examples/cloudflare-hono. Not sure if that impacts the way fpx is setup

@keturiosakys
Copy link
Member

Gotcha, looks similar - will ask the SST team about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants