anan7
anan7
TtRPC
Created by anan7 on 5/12/2023 in #❓-help
Dockerfile in Tubrorepo
I've noticed my build fails when I use yarn and I want to use npm but in the build section, it says no lock file found and begins to use yarn. when I run that build command locally it builds perfectly.
8 replies
TtRPC
Created by anan7 on 5/12/2023 in #❓-help
Dockerfile in Tubrorepo
FROM node:16-alpine RUN apk add --no-cache libc6-compat WORKDIR /app COPY . . ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED 1 RUN npm ci RUN npm run -w api dbgen RUN npm run -w web build EXPOSE 3000 CMD ["npm", "start", "-w", "web"]
8 replies
TtRPC
Created by anan7 on 5/12/2023 in #❓-help
Dockerfile in Tubrorepo
I'm actually failing to dockerise my nextjs app. forgot to mention that.
8 replies
TtRPC
Created by anan7 on 2/8/2023 in #❓-help
Websocket is not defined error
Little help here please?
3 replies
TtRPC
Created by anan7 on 2/8/2023 in #❓-help
Websocket is not defined error
My Next app's _app.tsx file is import React, { useState } from 'react'; import '../styles/globals.css'; import { AppProps } from 'next/app'; import Head from 'next/head'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { httpBatchLink, createWSClient, wsLink, splitLink } from '@trpc/client'; import { trpc } from '@/utils/trpc'; function getCookie(name: string) { const cookies = document.cookie.split(";"); for (let cookie of cookies) { let [cookieName, cookieValue] = cookie.trim().split("="); if (cookieName === name) return cookieValue; } return "empty"; } export default function SharedApp(props: AppProps) { const { Component, pageProps } = props; const [queryClient] = useState(() => new QueryClient()); const [trpcClient] = useState(() => trpc.createClient({ links: [ splitLink({ condition: op => { return op.type === "subscription" }, true: wsLink({ client: createWSClient({ url: 'ws://localhost:8000/trpc', }) }), false: httpBatchLink({ url: 'http://localhost:8000/trpc', headers() { return { authorization: getCookie("user-token"), }; }, }), }) ], }), ); return ( <trpc.Provider client={trpcClient} queryClient={queryClient}> <QueryClientProvider client={queryClient}> <Head> <title>Cravin</title> <link rel="icon" href="/cravinwebicon16.png" /> <meta name="description" content="An app for serving food" /> <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" /> </Head> <Component {...pageProps} /> </QueryClientProvider> </trpc.Provider> ); }
3 replies