Skip to content

nested SSR pages and API routes not working with all adapter plugins #1462

@thescientist13

Description

@thescientist13

What happened?

Noticed that any permutation of nested SSR pages or API routes won't work well with any of our adapter plugins 😱

For example, something like this will fail in some way with just about any adapter plugin

src/
  pages/
    api/
      webhook/
        event.js
    blog/
      first-post.js

Netlify

TBD

Vercel
Both return 404

Image
Image

AWS (SST)

 Created     ApiRouteXkzhmc sst:aws:ApiGatewayV2LambdaRoute → ApiRouteXkzhmcHandlerRole aws:iam:Role
|  Error       
|  Error: open .aws-output/api/webhook/event/resource.enc: no such file or directory
|      at IncomingMessage.<anonymous> (file:///home/runner/work/greenwood-demo-adapter-aws/greenwood-demo-adapter-aws/.sst/platform/src/components/rpc/rpc.ts:42:22)
|      at IncomingMessage.emit (node:events:530:35)
|      at IncomingMessage.emit (node:domain:489:12)
|      at endReadableNT (node:internal/streams/readable:1698:12)
|      at processTicksAndRejections (node:internal/process/task_queues:90:21) {
|    promise: Promise { <rejected> [Circular *1] }
|  }
|  Created     ApiRouteBbvonx sst:aws:ApiGatewayV2

AWS (Architect)

How do we have multiple SSR routes...?

deploy failed! Validation error:
- Invalid @http path (catchalls can only be used at the end of a path): get /blog/first-post*
Error: Validation error:
- Invalid @http path (catchalls can only be used at the end of a path): get /blog/first-post*
    at format (/home/runner/work/greenwood-demo-adapter-aws/greenwood-demo-adapter-aws/node_modules/@architect/inventory/src/lib/error-fmt.js:15:13)
    at /home/runner/work/greenwood-demo-adapter-aws/greenwood-demo-adapter-aws/node_modules/@architect/inventory/src/index.js:92:[18](https://github.com/ProjectEvergreen/greenwood-demo-adapter-aws/actions/runs/13976254860/job/39130697161#step:6:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Error: Process completed with exit code 1.

Steps to reproduce

  1. Create a nested SSR route (e.g. src/pages/blog/first-post.js)
  2. Create a nested API route (e.g. src/pages/api/webhook/event.js)
  3. Deploy with any Greenwood adapter

Environment

  • Any version of Greenwood
  • Any currently supported Adapter plugin (AWS w/ SST or Arc, Netlify, Vercel)

Additional Context


My guess is some of this has to do with mapping API / SSR route manifest output accordingly, but in the case Architect, it might be a bit more complicated with SSR routes...

Metadata

Metadata

Labels

Type

Projects

Status

👀 In review

Relationships

None yet

Development

No branches or pull requests

Issue actions