instantcommerce / next-api-decorators

Collection of decorators to create typed Next.js API routes, with easy request validation and transformation.
https://next-api-decorators.vercel.app
MIT License
409 stars 28 forks source link

Any named export would fail from working in vercel #597

Closed yoty66 closed 1 year ago

yoty66 commented 1 year ago

Just spent a whole afternoon on that.

Reproduce:

  1. take any example. let's say the getting started example and add it a named export
import { createHandler, Get } from 'next-api-decorators';

export const helloBug= ()=> {
return "hello bug" 
}

class UserHandler {
  @Get()
  public async users() {
    return await DB.findUsers();
  }
}

export default createHandler(UserHandler);
  1. deploy it to staging

  2. call the EP and get a 404

ggurkal commented 1 year ago

Can't reproduce the error you're getting with the provided steps.

Please provide a minimum reproducible repository.