lyricaldevil
lyricaldevil
TTCTheo's Typesafe Cult
Created by lyricaldevil on 10/3/2024 in #questions
ESLint error in NextConfig when customizing webpack
I know it's safe to ignore, I was just wondering if there was a way to safely type the webpack signature instead of just telling eslint to pound sand 😂
5 replies
TTCTheo's Typesafe Cult
Created by Grimmjoww231 on 7/13/2024 in #questions
shadcn dialog and form
I've done this a few times without a problem. In my experience that error usually comes from using the asChild prop with multiple children. I probably can't be more helpful without a code snippet to poke at.
3 replies
TTCTheo's Typesafe Cult
Created by Ani on 3/12/2023 in #questions
google next-auth error: invalid_client even if client id is correct
Did you ever figure out what the issue was here? I have the same issue - google auth suddenly stopped working despite seemingly nothing changing.
12 replies
TTCTheo's Typesafe Cult
Created by Adam on 12/16/2023 in #questions
Refreshing Stale UI After Deployment - Seeking Insights
I'm not aware of any out-of-the-box solutions to this, but if you wanted to spend the time, you could use websockets to "push" a notification to end users whenever there's an update. Wouldn't take a ton of effort, afaik.
8 replies
TTCTheo's Typesafe Cult
Created by Adam on 12/16/2023 in #questions
Refreshing Stale UI After Deployment - Seeking Insights
Additional shower thought: this is the sort of problem that can be solved with API versioning. Let the old client continue calling api/v1/endpoint1, while the new client calls api/v2/endpoint2
8 replies
TTCTheo's Typesafe Cult
Created by Adam on 12/16/2023 in #questions
Refreshing Stale UI After Deployment - Seeking Insights
You could handle those old endpoints more gracefully than just removing them. If there's a 1:1 replacement, call the new endpoint from the old. If not, you could throw an error message or something similar that explains what the issue is to the user and suggests refreshing the page to resolve it. Then, once you're sure there are no users with stale UI, you can remove the old endpoint.
8 replies
TTCTheo's Typesafe Cult
Created by lyricaldevil on 5/17/2023 in #questions
More Clerk + tRPC weirdness
That's accurate. the public route is basically just a static landing page that doesn't interact with tRPC or API in any way.
11 replies
TTCTheo's Typesafe Cult
Created by lyricaldevil on 5/17/2023 in #questions
More Clerk + tRPC weirdness
And here's the response body of an example tRPC request:
<head>
<meta charset="UTF-8" />
</head>
<body>
<script>
window.__clerk_frontend_api = '<REMOVED>.clerk.accounts.dev';
window.__clerk_debug = {"frontendApi":"<REMOVED>.clerk.accounts.dev","isSignedIn":false,"proxyUrl":"","isInterstitial":true,"reason":"cross-origin-referrer","message":"","publishableKey":"<REMOVED>","isSatellite":false,"domain":""};


window.startClerk = async () => {
function formRedirect(){
const form = '<form method="get" action="" name="redirect"></form>';
document.body.innerHTML = document.body.innerHTML + form;

const searchParams = new URLSearchParams(window.location.search);
for (let paramTuple of searchParams) {
const input = document.createElement("input");
input.type = "hidden";
input.name = paramTuple[0];
input.value = paramTuple[1];
document.forms.redirect.appendChild(input);
}
const url = new URL(window.location.origin + window.location.pathname + window.location.hash);
window.history.pushState({}, '', url);

document.forms.redirect.action = window.location.pathname + window.location.hash;
document.forms.redirect.submit();
}

const Clerk = window.Clerk;
try {
await Clerk.load({
isSatellite: false,
signInUrl: undefined
});
if(Clerk.loaded){
if(window.location.href.indexOf("#") === -1){
window.location.href = window.location.href;
} else if (window.navigator.userAgent.toLowerCase().includes("firefox/")){
formRedirect();
} else {
window.location.reload();
}
}
} catch (err) {
console.error('Clerk: ', err);
}
};
(() => {
const script = document.createElement('script');
script.setAttribute('data-clerk-publishable-key', '<REMOVED>');


;
script.async = true;
script.src = 'https://<REMOVED>.clerk.accounts.dev/npm/@clerk/clerk-js@latest/dist/clerk.browser.js';
script.crossOrigin = 'anonymous';
script.addEventListener('load', startClerk);
document.body.appendChild(script);
})();
</script>
</body>
<head>
<meta charset="UTF-8" />
</head>
<body>
<script>
window.__clerk_frontend_api = '<REMOVED>.clerk.accounts.dev';
window.__clerk_debug = {"frontendApi":"<REMOVED>.clerk.accounts.dev","isSignedIn":false,"proxyUrl":"","isInterstitial":true,"reason":"cross-origin-referrer","message":"","publishableKey":"<REMOVED>","isSatellite":false,"domain":""};


window.startClerk = async () => {
function formRedirect(){
const form = '<form method="get" action="" name="redirect"></form>';
document.body.innerHTML = document.body.innerHTML + form;

const searchParams = new URLSearchParams(window.location.search);
for (let paramTuple of searchParams) {
const input = document.createElement("input");
input.type = "hidden";
input.name = paramTuple[0];
input.value = paramTuple[1];
document.forms.redirect.appendChild(input);
}
const url = new URL(window.location.origin + window.location.pathname + window.location.hash);
window.history.pushState({}, '', url);

document.forms.redirect.action = window.location.pathname + window.location.hash;
document.forms.redirect.submit();
}

const Clerk = window.Clerk;
try {
await Clerk.load({
isSatellite: false,
signInUrl: undefined
});
if(Clerk.loaded){
if(window.location.href.indexOf("#") === -1){
window.location.href = window.location.href;
} else if (window.navigator.userAgent.toLowerCase().includes("firefox/")){
formRedirect();
} else {
window.location.reload();
}
}
} catch (err) {
console.error('Clerk: ', err);
}
};
(() => {
const script = document.createElement('script');
script.setAttribute('data-clerk-publishable-key', '<REMOVED>');


;
script.async = true;
script.src = 'https://<REMOVED>.clerk.accounts.dev/npm/@clerk/clerk-js@latest/dist/clerk.browser.js';
script.crossOrigin = 'anonymous';
script.addEventListener('load', startClerk);
document.body.appendChild(script);
})();
</script>
</body>
11 replies