vercel-community / rust

🦀 Rust runtime for ▲ Vercel Serverless Functions
https://rust-runtime.vercel.app
MIT License
845 stars 49 forks source link

Example `Experimental API Bundling` Not Working #124

Closed afifurrohman-id closed 1 year ago

afifurrohman-id commented 1 year ago

Description

As Example in README.md Have error occurred

error: custom attribute panicked
  --> api/main.rs:12:1
   |
12 | #[bundled_api]
   | ^^^^^^^^^^^^^^
   |
   = help: message: `"api\\_name_"` is not a valid identifier

error[E0425]: cannot find value `handler` in this scope
 --> api/main.rs:5:9
  |
5 |     run(handler).await
  |         ^^^^^^^ not found in this scope
ecklf commented 1 year ago

Did you also include a handler function below the macro as documented?

#[bundled_api]
pub async fn handler(req: Request) -> Result<Response<Body>, Error> {}
afifurrohman-id commented 1 year ago

Did you also include a handler function below the macro as documented?

#[bundled_api]
pub async fn handler(req: Request) -> Result<Response<Body>, Error> {}

in api/main.rs?

Yes, already included

ecklf commented 1 year ago

Can you provide a reproduction repo and your system information? Afaik there is a report for it not working on Windows so hence I'm asking.

afifurrohman-id commented 1 year ago

Can you provide a reproduction repo and your system information? Afaik there is a report for it not working on Windows so hence I'm asking.

Sorry, i doesn't have that repository. Just copy paste from example

I running on windows 11 amd64

ecklf commented 1 year ago

Closing then as duplicate of https://github.com/vercel-community/rust/issues/108