Sid
Sid
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Sid on 9/12/2024 in #questions
Single react query doesn't seem to hit then endpoint in production (Vercel)
Hi there, Thought i'd ask here as i'm at a loss I have a dashboard page with 2 queries: 1. getRecentContent 2.getDashboardStats When I load the page in production, the Vercel logs show that only getDashboardStats is getting hit, getDashboardStats doesn't, even though its on the same page So I figured it was a FE problem, so I went to log the query stuff, I notice: 1. The query is running 2. It flips from isLoading instantly, suggestive of something being returned very quickly before a network request is being made 3. The other query takes far longer to load in because it is actually hitting the API It executes as expected in development I would have thought there was some weird caching thing, but the two procedures are on the same router, and accessible via the same api route Has anyone faced something similar, or can suggest something to look into?
9 replies
RRailway
Created by Sid on 9/11/2024 in #✋|help
What port does railway expose for node apps?
I have a very simple express app, I have it in a monorepo just to test some stuff, it builds fine, it starts fine, but I get the "application failed to respond" error when going to it on the provided domain I'm logging all traffic, and I can see that I'm not getting any when navigating to the domain I've tested the build locally, and it builds and starts just fine Any ideas?
import express from "express";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const app = express();
const PORT = 3000;

app.use(express.static(path.join(__dirname, "dist")));

app.get("*", (req, res) => {
console.log("Request made: ", req.path);
res.sendFile(path.join(__dirname, "dist", "index.html"));
});

app
.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
})
.on("error", (err) => {
console.log(`Error: ${err}`);

process.exit(1);
});
import express from "express";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const app = express();
const PORT = 3000;

app.use(express.static(path.join(__dirname, "dist")));

app.get("*", (req, res) => {
console.log("Request made: ", req.path);
res.sendFile(path.join(__dirname, "dist", "index.html"));
});

app
.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
})
.on("error", (err) => {
console.log(`Error: ${err}`);

process.exit(1);
});
12 replies
RRailway
Created by Sid on 9/10/2024 in #✋|help
Build fails with: ts-node: not found
No description
43 replies
TTCTheo's Typesafe Cult
Created by Sid on 6/12/2024 in #questions
How can we enable experimental TRCP features?
I'm using the app router, and i'm getting type errors when trying to enable experimental TRCP features, specifically, i'm trying to enable streaming responses: https://www-git-05-01-stream-trpc.vercel.app/docs/client/links/httpBatchStreamLink#generators But adding it to the initTRCP function gives me a type error:
const t = initTRPC.context<typeof createTRPCContext>().create({
experimental: {
iterablesAndDeferreds: true,
},
transformer: superjson,
errorFormatter({ shape, error }) {
return {
...shape,
data: {
...shape.data,
zodError:
error.cause instanceof ZodError ? error.cause.flatten() : null,
},
};
},
});
const t = initTRPC.context<typeof createTRPCContext>().create({
experimental: {
iterablesAndDeferreds: true,
},
transformer: superjson,
errorFormatter({ shape, error }) {
return {
...shape,
data: {
...shape.data,
zodError:
error.cause instanceof ZodError ? error.cause.flatten() : null,
},
};
},
});
I've tried updating the TRCP packages, but that seems to not work. Has anyone had any luck with this?
1 replies
RRailway
Created by Sid on 4/24/2024 in #✋|help
Is there any way to override environment variables locally?
With railway run, you get all of the environment variables for that service, but is there anyway to override some of them before running the command?
4 replies
RRailway
Created by Sid on 4/17/2024 in #✋|help
TLS certificate has taken over 24 hours for a custom domain
No description
8 replies
RRailway
Created by Sid on 1/31/2024 in #✋|help
Can we determine the sequence of deployments?
I'm using Turborepo and I want to make sure my backend is deployed before my frontend, pushing to the repo will kick of both services to deploy at the same time. Is there any way to configure this?
21 replies
RRailway
Created by Sid on 1/31/2024 in #✋|help
How to set up a staging -> production workflow?
I'm trying to set up a workflow whereby a push to master will build and auto deploy to our staging environment on railway but not autodeploy on our production environment until we approve the staging environment works correctly. How can I go about doing this in railway? The docs show a "disable trigger" button but the UI has changed, and I can't find a "deploy" button anywhere
15 replies