ed.upton
ed.upton
TTCTheo's Typesafe Cult
Created by ed.upton on 6/4/2023 in #questions
Use Clerk `getAuth(req)` in a Zact server action
Is there a way to get the Next request object in a Zact server action. I require this to be able to get the current user using Clerk's getAuth function
14 replies
TTCTheo's Typesafe Cult
Created by ed.upton on 5/27/2023 in #questions
Recursive References in TypeScript
I'm stuck with a very specific TS/JS problem, which may not be solvable but I thought I'd see if anyone here has a cool idea on how to solve it. So I have a file index.ts with a mapping from some keys to objects:
import A from "a.ts";
import B from "b.ts";
...

const mapping = {
"a": A,
"b": B,
...
};
import A from "a.ts";
import B from "b.ts";
...

const mapping = {
"a": A,
"b": B,
...
};
Then, in the files that contain the objects, they may refer to each other, e.g. in a.ts I may have:
import B from "b.ts";

const A = {
"something": B;
...
}

export default A;
import B from "b.ts";

const A = {
"something": B;
...
}

export default A;
Currently with this setup, I get __WEBPACK_DEFAULT_EXPORT__ and Cannot access 'B' before initialization errors.
3 replies
TTCTheo's Typesafe Cult
Created by ed.upton on 5/10/2023 in #questions
How to Push schema from drizzle to planetscale
I've moved from Prisma to Drizzle, but wondering if there is an alternative to the prisma db push
3 replies
TTCTheo's Typesafe Cult
Created by ed.upton on 2/8/2023 in #questions
Get tRPC Connection Status
Is there a way I can get the current connection status without having to create a specific query that regularly pings?
9 replies
TTCTheo's Typesafe Cult
Created by ed.upton on 2/7/2023 in #questions
Next Build Works Locally, But Not on Server
Running yarn build (i.e. next build) locally successfully creates the optimised build, with the following output:
info - Linting and checking validity of types...
info - Creating an optimized production build...

🌼 daisyUI components 2.33.0 https://github.com/saadeghi/daisyui
✔︎ Including: base, components, themes[1], utilities

info - Compiled successfully
info - Collecting page data...
info - Generating static pages (0/12)
info - Generating static pages (3/12)
info - Generating static pages (6/12)
info - Generating static pages (9/12)
info - Generating static pages (12/12)
info - Finalizing page optimization...
Done in ...
info - Linting and checking validity of types...
info - Creating an optimized production build...

🌼 daisyUI components 2.33.0 https://github.com/saadeghi/daisyui
✔︎ Including: base, components, themes[1], utilities

info - Compiled successfully
info - Collecting page data...
info - Generating static pages (0/12)
info - Generating static pages (3/12)
info - Generating static pages (6/12)
info - Generating static pages (9/12)
info - Generating static pages (12/12)
info - Finalizing page optimization...
Done in ...
However, when its built on my production server, it seems to only lint (even though it is still running next build) with this output:
info - Linting and checking validity of types...
Done in 110.69s.
info - Linting and checking validity of types...
Done in 110.69s.
I don't get this problem on previous versions of my code, and I'm wondering if somehow the build is silently failing?
2 replies
TTCTheo's Typesafe Cult
Created by ed.upton on 2/5/2023 in #questions
Next Build Stops After Type Validations
I have a dokku deployment set up which when running, no longer successfully builds my app. The logs outputted are the following:
-----> Build
Running build (yarn)
yarn run v1.22.19
$ next build
info - Loaded env from /tmp/build/.env
warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info - Linting and checking validity of types...
Done in 98.61s.

-----> Build
Running build (yarn)
yarn run v1.22.19
$ next build
info - Loaded env from /tmp/build/.env
warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info - Linting and checking validity of types...
Done in 98.61s.

and you can see that it does not output the actual building and optimisation steps, e.g.:
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
info - Generating static pages (12/12)
info - Finalizing page optimization
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
info - Generating static pages (12/12)
info - Finalizing page optimization
Running the build locally works fine, and deploying the previous working commit still works as expected.
2 replies