rust icon indicating copy to clipboard operation
rust copied to clipboard

`bundled_api` macro fails on Windows machine, still works on linux, remote building on vercel works on both

Open mnpqraven opened this issue 1 year ago • 1 comments

I received this error when I try to build locally on my Windows machine with the new api bundling macro:

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

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

Even though this error didn't show up in my linux machine with the same code, I've also tried cargo clean but no luck. If I commit to git and let vercel builds for me, then it still builds without any issue image this is my vercel.json

{
	"outputDirectory": "public",
	"functions": {
		"api/main.rs": {
			"runtime": "[email protected]"
		}
	},
	"crons": [
		{
			"path": "/api/cron/write_characters_db",
			"schedule": "0 1 * * *"
		}
	]
}

mnpqraven avatar Jun 16 '23 11:06 mnpqraven

Do you happen to have a reproduction repo and toolchain configuration? I'm not super familiar with Windows and I'm unable to build the crates at all due to singal-hook issues.

ecklf avatar Aug 23 '23 13:08 ecklf