Code Handbook
Newsletter Contact

Next.js

Redirect in Next.js

How to do server side redirect in Next.js application ? Page Router If you are using page router then from inside your data fetching method you can return redirect. export async function getServerSideProps(){ if(!userIsAuthenticated()){ //...
Jay
Aug 2, 2023

Next.js

Next.js Image Not Found

Image not found while setting src in Next.js Issue was the place where I was keeping my images folder. Images folder needed to be inside the public directory. And here is how it was referenced...
Jay
Apr 24, 2023

Next.js

How to Fetch Data From API Server Side | Next.js | getServerSideProps

How to Make an API call from server side in Next.js using getServerSideProps In this tutorial, you’ll see how you can make an API call from server side using getServerSideProps. Using getServerSideProps you can make...
Jay
Apr 23, 2023

Next.js

How to Make API Calls In Next.js

How to make an API call after the page has rendered in Next.js In this Next.js video tutorial, you’ll learn how to make API call in the client side using useEffect hook and fetch API....
Jay
Apr 21, 2023

Next.js

Data Fetching in Next.js Using getStaticProps

Fetch data from REST API in Next.js during build time to create pages in server side using getStaticProps. In this Next.js project tutorial, you’ll learn how to fetch data in Next.js using getStaticProps. The video...
Jay
Apr 18, 2023

Other

How to Sign Out of GMAIL App

How to logout of Gmail App from your Android device? or How to remove Google account from Android device ? In the following video tutorial, I demonstrate how to remove, sign out or logout of...
Jay
Apr 17, 2023

JavaScript, 

Cognito, 

Next.js

AWS Cognito: Parse Google Sign Mapped Attribute - Gender

Recently I had integrated Google sign using AWS Cognito in my Next.js application. I had mapped the Google attributes with some custom attributes in my user pool. So custom field custom:social_gender was mapped to Google...
Jay
Apr 16, 2023

Jekyll, 

Liquid

Liquid Exception: undefined method `tainted?` for 2:Integer

While running Jekyll I was getting the following error, Liquid Exception: undefined method `tainted?’ for 2:Integer The above issue occured when after a windows re install I had to re install Ruby. The issue seemed...
Jay
Apr 8, 2023

Next.js

How to Delete Cookies in Next.js

How to Remove Cookies in Next.js? Recently I had a requirement to remove all cookies from the Next.js app’s domain. The Next.js page was using getServerSideProps. Here is how the code looked const deleteCookies =...
Jay
Apr 3, 2023

JavaScript

How to Get Date in Text in JavaScript

How to Convert Date to Text in JavaScript? let currentDateObj = new Date(); let currentDate = currentDateObj.toString(); As seen above the Date object has the .toString method which converts date to string.
Jay
Mar 31, 2023

TypeScript

Operator '+' cannot be applied to types 'Number' and 'Number'

While assigning variable type as Number got the following error in TypeScript, Operator ‘+’ cannot be applied to types ‘Number’ and ‘Number’ const foo = (a:Number,b: Number) => { return a+b; } So what’s wrong...
Jay
Mar 30, 2023

Next.js

Getting "A required parameter (id) was not provided as a string in getStaticPaths" error in Next.js

Getting the following error in Next.js - A required parameter (id) was not provided as a string in getStaticPaths While using getStaticPath in Next.js pages I was getting the above error. Here is my method,...
Jay
Mar 29, 2023
« Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Next »

Contact

  • Email
  • Guest Writing
  • Sponsorship Info

Follow

  • Youtube
  • Twitter
  • Facebook
  • GitHub

© 2010-2021 - Code Handbook - Everything related to web and programming.