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

Amend behaviour for selecting path prefix in proc macro #103

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

dglsparsons
Copy link
Collaborator

We encountered an issue deploying the examples/route-merge directory, insofar as it worked locally, and worked with vc --prebuilt, but deploying via the Vercel build system by running vercel deploy resulted in all the API routes panicing.

This happens because:

  • The routes are properly formed and specified from the rust runtime package (typescript side). Meaning we create the correct Vercel functions.
  • However, no routes are picked up by the proc macro.

The vercel deploy command only uploads the current directory into Vercel. Meaning when built via the Vercel build system, the examples/route-merge directory does not appear to be part of a cargo workspace. The path prefix specified then does not point to examples/route-merge/api/**.rs, but instead to
examples/route-merge/examples/route-merge/api/**.rs, meaning no routing are created.

The fix for this is to fall back to acting as if no path is specified in the case where {path}/api/main.rs cannot be found.

We encountered an issue deploying the `examples/route-merge` directory,
insofar as it worked locally, and worked with `vc --prebuilt`, but
deploying via the Vercel build system by running `vercel deploy`
resulted in all the API routes panicing.

This happens because:
- The routes are properly formed and specified from the rust runtime
  package (typescript side). Meaning we create the correct Vercel
  functions.
- However, no routes are picked up by the proc macro.

The `vercel deploy` command only uploads the current directory into
Vercel. Meaning when built via the Vercel build system, the
`examples/route-merge` directory does not appear to be part of a cargo
workspace. The path prefix specified then does not point to
`examples/route-merge/api/**.rs`, but instead to
`examples/route-merge/examples/route-merge/api/**.rs`, meaning no
routing are created.

The fix for this is to fall back to acting as if no `path` is specified
in the case where `{path}/api/main.rs` cannot be found.
@dglsparsons dglsparsons requested a review from ecklf June 5, 2023 08:08
@ecklf ecklf merged commit ec4b622 into main Jun 5, 2023
@ecklf ecklf deleted the fix-path-detection branch June 5, 2023 08:31
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

Successfully merging this pull request may close these issues.

None yet

2 participants