jamesmoran
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
@asmodig remove the env import from the next config file
22 replies
TTCTheo's Typesafe Cult
•Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
I see, so you have moved the env import outside of you next config. That would fix the problem I am running into right now!
22 replies
TTCTheo's Typesafe Cult
•Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
I did not, but I just saw that the build failed. Looks like I have a bit more tinkering to do to get this working…
22 replies
TTCTheo's Typesafe Cult
•Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
After trying to add some functionality to my custom server, I realised:
- Paths I had set up in my tsconfig.json were not recognised
- The .mjs file extension is not supported
The paths fix was easy. All I did was:
1. Install the following dependency:
2. Add the following to my tsconfig.server.json file:
Now, for the .mjs file, I really wanted to keep the .mjs file extension, but I just couldn't figure out a way to get it working. In the end, I reluctantly converted
src/env.mjs → src/env.js
.
If anyone figures out how to get it working, I would love to hear it!22 replies
TTCTheo's Typesafe Cult
•Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
These are the steps I took:
1. Install dependencies:
2. Update package.json scripts:
3. Add nodemon.json file:
4. Update tsconfig.json
"checkJs": true
to "checkJs": false
5. Add tsconfig.server.json file:
6. Add the server.ts file:
Sources:
- https://nextjs.org/docs/advanced-features/custom-server
- https://github.com/vercel/next.js/tree/canary/examples/custom-server22 replies
TTCTheo's Typesafe Cult
•Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
I got this working. I’m not at my computer right now, but happy to share the steps I took when I’m back
22 replies
TTCTheo's Typesafe Cult
•Created by jamesmoran on 4/17/2023 in #questions
Simplest way to add cron job scheduler (PostgreSQL)
Thank you! I will stick to the custom server in that case
4 replies