Next.js Discord

Discord Forum

best way to deploy next frontend and trpc server monorepo?

Unanswered
Russian Blue posted this in #help-forum
Open in Discord
Russian BlueOP
my build script
 "scripts": {
    "dev": "bun --bun next dev",
    "build": "bun --bun next build",
    "start": "bun --bun next start",
    "lint": "eslint",
    "dev:server": "bun --watch packages/server/src/index.ts"
  },


but getting some errors that lead me to believe my server is not building correctly, although the server is hosted on railway.

3 Replies

Russian BlueOP
bun run build
locally works perfectly fine, but on nextjs production breaks.
and the error im seeing in production
Failed to compile.
./app/dashboard/client.tsx:32:40
Type error: Property 'keys' does not exist on type '"The property 'useContext' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'useUtils' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'Provider' in your router collides with a built-in ...'.
  Property 'keys' does not exist on type '"The property 'useContext' in your router collides with a built-in method, rename this router or procedure on your backend."'.
  30 |
  31 |   // Use initialData from server
> 32 |   const { data: keys, refetch } = trpc.keys.list.useQuery(undefined, {
     |                                        ^
  33 |     // initialData: initialKeys,
  34 |     staleTime: 60 * 1000, // Cache for 1 minute
  35 |   });
monorepo build order issue?