next-rest-framework icon indicating copy to clipboard operation
next-rest-framework copied to clipboard

TS error when doing `export const {POST}`

Open antspy opened this issue 5 months ago • 0 comments

Hi,

I have the following code (copied from the docs):

import { rpcRoute } from 'next-rest-framework'

export const { POST } = rpcRoute({
  myRPC,
})

export type RpcClient = typeof POST.client

But typescript complains about the POST variable definition:

Exported variable 'POST' has or is using name 'NrfOasData' from external module "node_modules/next-rest-framework/dist/index" but cannot be named.ts(4023)

Not sure what this is about, I guess something must be fixed on the library side?

antspy avatar Jul 18 '25 07:07 antspy