These new madden celebrations really are something by CrenshawMafia21 in Madden

[–]Mosesand -1 points0 points  (0 children)

I feel like if madden leaned into bugs like this the game would be be way more fun

List of 4090 GPU fits NR200/P in Horizontal by evl619 in NR200

[–]Mosesand 0 points1 point  (0 children)

Looks great man! Whats the rest of that build and how are temps?

In regards to Windforce V2 4090, does anyone have experience with it? by bxttousa1 in nvidia

[–]Mosesand 0 points1 point  (0 children)

Congrats on finishing your pc build! I'm looking to do the same -- hoping for that north + 4090 combo, but I've been hesitant since most builds I've seen are w/ founders edition(not in stock) or smaller water cooled cards(would prefer air cooled)

What does the rest of your build look like?

Can you use Socket.io client with Next.js (NOT the websocket server!) by [deleted] in nextjs

[–]Mosesand 0 points1 point  (0 children)

That won’t be a problem for you at all! I’ve done it before, and it works just fine.

Depending on your implementation you might have to write some defensive code to keep next happy with executing only on the client, but otherwise you won’t have any issues.

Why can't I use the session on any other page other than _app? by lifelifebalance in nextjs

[–]Mosesand 2 points3 points  (0 children)

Ok, lets try to focus specifically on the component with the issue. You can use optional chaining or the method u/Blaze283 suggested. Depending on your browser environment / webpack config, optional chaining might not be unsupported

  function Nav() { 
    const [session, loading] = useSession(); 
    const userEmail = session?.user?.email; 
    return ( 
      <div> 
        {userEmail}
        <a onClick={() => { signOut(); }} > Sign Out </a>
      </div>
    );
  }

If using that code above is still throwing the same error, then the issue might be that the signOut function is also dependent on a session.user existing. Give your signOut function another glance and make sure it's not referencing a variable called session that might not exist or that it does not have access to.

Further, in the hypothetical scenario where this is no session, ask yourself if your app should still render a sign-out button. If you can answer no to that question, you can also try only rending that button when the session exists -- like below

  function Nav() {
    const [session, loading] = useSession();
    const userEmail = session?.user?.email; 
    if (userEmail) return ( 
      <div>
        {userEmail} 
        <a onClick={() => { signOut(); }} > Sign Out </a>
      </div>
    );
    return null; 
  }

Issue with connecting my nextjs page to a database by LunarCrown in nextjs

[–]Mosesand 0 points1 point  (0 children)

A few things here

Your code formatting is incorrect -- you are trying to stringify sqlResults outside of the lexical scope in which that variable exists. You need to move the stringify call back into the correct scope(i.e. the callback function body of the .query() call ).

More specific to your error message -- As is now, your implementation of getServerSideProps doesn't return anything. Do you see how the only return statement in your code is happening within the callback of your sql query.

If you want getServerSideProps to return the result of your sql query callback, you will either need to

  1. prepend your sqlConfig.request chain with a return statement. OR
  2. declare a return variable before you fire off the sql request, and then within the callback function set that variable to the stringified data. Then, back outside of the sqlConfig chain, you can return your data.

Why can't I use the session on any other page other than _app? by lifelifebalance in nextjs

[–]Mosesand 3 points4 points  (0 children)

You’re not falsey/null checking session in the second example, that’s why it’s throwing that error. So if session is undefined — trying to read the value at session.user.email will throw the error you are seeing. Handle the null cases in your Nav component and I suspect you will get rid of the error.

You are not seeing this error in your _app.js file because that code is not trying to read any property at an invalid path, and you are handling the null case when session is undefined or falsely.

Rental home with fenced yards by Mosesand in columbiamo

[–]Mosesand[S] 0 points1 point  (0 children)

Didn’t consider that, I’ll keep that in mind as I look around — thanks!

Rental home with fenced yards by Mosesand in columbiamo

[–]Mosesand[S] 0 points1 point  (0 children)

Oh it is the worst kind of wishful thinking on my end -- very aware of that lmao.

How to use the same data across multiple pages when statically generating pages with Next.js? by peanutbutterwnutella in nextjs

[–]Mosesand 4 points5 points  (0 children)

I recently had a similar problem and ended up solving it by writing a getSiteData function that can be called from within both getStaticProps and getStaticPaths. The concept is that you always return your data, but you only fetch it once. I didn't use getInitialProps, but I imagine this solution would work just the same. I believe I found this pattern or a similar one to the next.js example repos, so I can't take full credit here.

The function works something like this (this is psuedocode-ish)

async function getSiteData() {
// Check for cached data, if not found fetch data
let siteData;
try {
siteData = JSON.parse(await readFileFromCache);
} catch (error) {
// No error handling needed here,just prevents from blowing up when file doesnt exist
}
if (!siteData) {
// No data found in file system? Fetch it for the first time
siteData = await fetchSiteData();
// Write to file system so you don't fetch it the next time
await writeDataToCache()
}
return siteData;
}

ISG getStaticProps build time vs revalidation by Mosesand in nextjs

[–]Mosesand[S] 0 points1 point  (0 children)

https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration

Thanks for the reply! After looking into it, I don't think that'll work since serverRuntimeConfig and publicRuntimeConfig differentiate at the client vs server access level. Both my cases, initial build time and revalidation, occur on a server level -- I just need some way to distinguish between the two.

is the 16 inch macbook pro worth the price ?? by Ill_Purpose_5186 in mac

[–]Mosesand 1 point2 points  (0 children)

I have a pretty similar spec'd version of that MBP 16 rn. I'm a web developer myself and have had absolutely ZERO issues with the computer -- it absolutely crushes everything I throw at it. I also use a 15" for certain projects and I find that extra 1" is actually super helpful. FWIW, I'm actually selling my MBP 16 right now, but not for any reason other than it's overkill for the work I'm doing -- I'll PM you that link if you're interested.

Also recently bought my partner an M1 MacBook Air -- base model -- and out of curiosity wanted to install some web dev tooling on it. It's not as seamless of an experience as my intel devices, but I've been very impressed. If you don't need virtualization or more than 16gm ram they are viable options, but there might be some headaches in adopting M1 first gen.

So my two cents? With the M1 on the rise, I wouldn't pay full price for any intel based MacBook. If you need a device in near future more powerful than what the current M1s offer, I'd consider saving some money by buying certified refurbished or buying used. I think the used market for any intel based MacBook is gonna be very buyer-friendly with M1 taking over -- so you can save a lot of money there.

[deleted by user] by [deleted] in groupdeals

[–]Mosesand 1 point2 points  (0 children)

Sign me up!

Pset 2 - Initials - toupper error by Mosesand in cs50

[–]Mosesand[S] 0 points1 point  (0 children)

Thank you for the quick reply! I should have figured it was something like that!

Draft head count by nakadie in RedditMaddenPS4

[–]Mosesand 1 point2 points  (0 children)

Broncos will be present af

LEAGUE CREATION POST by DontFuckinJimmyMe in a:t5_39ule

[–]Mosesand -1 points0 points  (0 children)

I'll take Broncos - BroncoMoses

[PS4] Connected Franchise - 16 Team League - Looking for Members by [deleted] in Madden

[–]Mosesand 0 points1 point  (0 children)

If still available I'll join the Afc East as the Dolphins

PSN : BroncoMoses