projectx-codehagen/Badget

Bug: Pricing page returns "Something went wrong!"

Closed this issue · 3 comments

Describe the bug

Got a error when try to access Pricing page (authenticated or not):

image

Steps to reproduce

  1. Go to https://projectx-eight-gilt.vercel.app/
  2. Click on "Pricing"

Browsers

Chrome, Firefox, Safari, Edge, Opera

Additional context (Is this in dev or production?)

No response

I just think that its the wrong /pricing that is.

Started the app locally and tried to repro this. This is what I am seeing in the Next.js logs when I navigate to the /pricing page:

 ✓ Compiled /pricing in 1425ms (2374 modules)
 >> query  #1 auth.mySubscription  { input: undefined }
<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (101kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
 ○ Compiling /api/trpc/edge/[trpc] ...
 ✓ Compiled /api/trpc/edge/[trpc] in 1528ms (1156 modules)
Error in tRPC handler (edge) on path auth.mySubscription
[TRPCError: UNAUTHORIZED] { code: 'UNAUTHORIZED', name: 'TRPCError' }
 << query  #1 auth.mySubscription  {
  input: undefined,
  result: TRPCClientError: UNAUTHORIZED
      at Function.from (webpack-internal:///(rsc)/../../node_modules/@trpc/client/dist/TRPCClientError.mjs:30:20)
      at eval (webpack-internal:///(rsc)/../../node_modules/@trpc/client/dist/links/internals/createHTTPBatchLink.mjs:68:110)
      at processTicksAndRejections (node:internal/process/task_queues:95:5) {
    meta: { response: [Response], responseJSON: [Array] },
    shape: { message: 'UNAUTHORIZED', code: -32001, data: [Object] },
    data: {
      code: 'UNAUTHORIZED',
      httpStatus: 401,
      stack: 'TRPCError: UNAUTHORIZED\n' +
        '    at eval (webpack-internal:///(rsc)/../../packages/api/src/trpc.ts:94:15)\n' +
        '    at callRecursive (webpack-internal:///(rsc)/../../packages/api/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:133:38)\n' +
        '    at procedure (webpack-internal:///(rsc)/../../packages/api/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:163:30)\n' +
        '    at callProcedure (webpack-internal:///(rsc)/../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:103:12)\n' +
        '    at eval (webpack-internal:///(rsc)/../../node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs:147:94)\n' +
        '    at Array.map (<anonymous>)\n' +
        '    at resolveHTTPResponse (webpack-internal:///(rsc)/../../node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs:144:32)',
      path: 'auth.mySubscription',
      zodError: null
    },
    [cause]: undefined
  },
  elapsedMs: 1738
}
 ⨯ ../node_modules/@trpc/client/dist/TRPCClientError.mjs (26:19) @ Function.from
 ⨯ Internal error: TRPCClientError: UNAUTHORIZED
    at Function.from (../../node_modules/@trpc/client/dist/TRPCClientError.mjs:30:20)
    at eval (../../node_modules/@trpc/client/dist/links/internals/createHTTPBatchLink.mjs:68:110)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
null

I'm new to TRPC but it looks like it's a TRPCClientError

Got it! Going to look into it. Looks like its the middleware, but going to talk with the Backend guys to hear @alexghirelli