PrismaP
Prisma5mo ago
11 replies
Gregersen

Anyone else seeing "The inferred type cannot be named..." errors after 6.16 update?

I was updating our Prisma from 6.15 to 6.16, and decided to try out the new rustfree engine now that its GA.

However, upon doing so, almost all of our tRPC routes starts throwing errors:
The inferred type of 'X' cannot be named without a reference to '../../node_modules/@spaak/db/generated/client/client'. This is likely not portable. A type annotation is necessary.ts(2742)


Our tRPC setup is somewhat large and complex (320 handlers, with around 20-30 routers), looking roughly like this:
export const observeRouter = createTRPCRouter({
  observation: observationRouter,
  tabFolder: tabFolderRouter,
  developer: developerRouter,
  pending: observePendingRouter,
  statistics: observeStatisticsRouter,

  getObservationDocumentIds: featureProtectedProcedure(
    ApplicationFeature.OBSERVE,
  )
    .input(ZGetObservationDocumentIdsInput)
    .mutation(async (opts) => {
      const handler = await importHandler(
        namespaced("getObservationDocumentIds"),
        () => import("./getObservationDocumentIds.handler"),
      );

      return handler(opts);
    }),
    ...

This is a mix of nested routers and new routes, to organize our endpoints into namespaces and meaningful folders, keeping things scoped how we want.

This observeRouter doesn't show the error if I comment out all the handlers, and leave only the routers.
What's strange is, that none of the handlers are showing any errors.

Is anyone else seeing this?

I am not sure how this relates to Prisma at all, but curious to hear if anyone else has experienced this.
Was this page helpful?