How to get hotloading to work with t3 + sst?

built project using create-t3-app. did some small extra stuff (pointing prisma to supabase db, changed discord auth to google auth) installed sst so i didn't need to run it from npx package.json:
"sst": "^2.43.1",
"aws-cdk-lib": "2.142.1",
"constructs": "10.3.0"
"sst": "^2.43.1",
"aws-cdk-lib": "2.142.1",
"constructs": "10.3.0"
sst.config.ts
import { SSTConfig } from "sst";
import { NextjsSite } from "sst/constructs";

export default {
config(_input) {
return {
name: "next-js-typescript-example-sst",
region: "us-east-2",
};
},
stacks(app) {
app.stack(function Site({ stack }) {
const site = new NextjsSite(stack, "site");

stack.addOutputs({
SiteUrl: site.url,
});
});
},
} satisfies SSTConfig;
import { SSTConfig } from "sst";
import { NextjsSite } from "sst/constructs";

export default {
config(_input) {
return {
name: "next-js-typescript-example-sst",
region: "us-east-2",
};
},
stacks(app) {
app.stack(function Site({ stack }) {
const site = new NextjsSite(stack, "site");

stack.addOutputs({
SiteUrl: site.url,
});
});
},
} satisfies SSTConfig;
package.json scripts
"backend:dev": "sst dev",
"frontend:dev": "sst bind next dev",
"backend:dev": "sst dev",
"frontend:dev": "sst bind next dev",
When I go to run the app I run (from the main folder) "npm run backend:dev", and afterwords "npm run frontend:dev" in another terminal. (I'm not sure if these naming conventions for the scripts are really correct, since in the "backend" terminal it shows publishing the Site and the "frontend" terminal it shows the prisma:query which i would also expect to be on a backend but you know.) biggest problem though is that it doesn't hotreload on any changes, i have to ctrl+c to exit and run them again to see my changes. Anything obvious I'm doing wrong here?
1 Reply
Dune Dune Hakusho
Dune Dune HakushoOP7mo ago
I thought maybe it was because I was adding in sst later drop-in style. so i rebuilt it starting with create-sst and then using create-t3-app to make a "frontend" project folder in my packages dir that sst makes. then set up the site stack. Once again, everything works properly in terms of the website, but if i try to add like "TEST" to the hello greeting p tag on the frontend or "TEST" to the string being returned from the sever part, then reload the page, nothing changes and the "sst bind run dev" terminal doesn't recompile anything
Want results from more Discord servers?
Add your server