#i am stuck on a bug from past 9-10days ,

17 messages · Page 1 of 1 (latest)

zinc widget
#

for example :

i am on page "/hotel/hote-pearl/rooms"

when i click on button it redirects to the new page " /hotel/hote-pearl/rooms/premium"

and when i click back button on the device and come to the page "/hotel/hote-pearl/rooms",
i get application error: a client-side exception has occurred (see the browser console for more information).

but when i refresh the page, it starts working perfectly.

covert coralBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

gaunt wadi
#

@zinc widget What is the error on console?

zinc widget
#

the props which are supposed to come from serversideprops are undefined

#

but when i refresh the page

#

it starts working fine

fading sundial
#

you'll need to show some code, we cannot guess from this much information

deft schoonerBOT
# zinc widget for example : i am on page "/hotel/hote-pearl/rooms" when i click on button i...
Please add more information to your question

Your question currently does not have sufficient information for people to be able to help. Please add more information to help us help you, for example: relevant code snippets, a reproduction repository, and/or more detailed error messages. See more info on how to ask a good question in https://discord.com/channels/752553802359505017/1138338531983491154 and #welcome message

zinc widget
#

/hotel index.ts

export async function getServerSideProps(context: any) {
const { params, query, req, res } = await context;

const { checkin, checkout, num_nights, num_guests, num_children, num_rooms } =
hotelPageQueryHandler(query);

const hotel_slug = params?.hotelInfo;
let fetchHotelParams = new FetchHotelDetailsQueryParams();
fetchHotelParams.hotelSlugName = hotel_slug;
fetchHotelParams.numGuests = Number(num_guests);
fetchHotelParams.checkInDate = checkin;
fetchHotelParams.checkOutDate = checkout;
fetchHotelParams.fetchHotelAmenityList = true;
fetchHotelParams.fetchHotelFAQList = true;
fetchHotelParams.fetchHotelNearbyPlacesList = true;
fetchHotelParams.fetchHotelNearbyHotelsList = true;
fetchHotelParams.fetchHotelRoomsList = true;
fetchHotelParams.fetchAllHotelRoomsList = true;

const { hotelDetails } = await getHotelInformationDetails(fetchHotelParams);

const serializedHotelInfoDetails = JSON.stringify(hotelDetails);

return {
props: {
hotelInfoDetails: JSON.parse(serializedHotelInfoDetails),
checkin: String(checkin),
checkout: String(checkout),
num_nights: num_nights,
num_guests: num_guests,
num_rooms: num_rooms,
num_children: num_children,
},
};
}

#

/hotel/[roomId]

export async function getServerSideProps(context: any) {
const { params, query, req, res } = await context;

const { checkin, checkout, num_nights, num_guests, num_children, num_rooms } =
hotelPageQueryHandler(query);

const hotelSlugName = params?.hotelInfo;
const roomId = params?.roomId;

const hotelDetails: HotelInformationDetails =
await getHotelBookingPageDetails(hotelSlugName + "");
const roomDetails: HotelRoomInformation = await getHotelRoomPageDetails(
hotelSlugName,
roomId,
checkin,
checkout
);
const serializedHotelDetails = JSON.stringify(hotelDetails);
const serializedHotelRoomDetails = JSON.stringify(roomDetails);

return {
props: {
hotelDetails: JSON.parse(serializedHotelDetails),
roomDetails: JSON.parse(serializedHotelRoomDetails),
checkin: String(checkin),
checkout: String(checkout),
num_nights: num_nights,
num_guests: num_guests,
num_rooms: num_rooms,
num_children: num_children,
},
};
}

#

i am getting error in production,

#

its working fine in dev

#

even after building it

zinc widget
zinc widget
#

framework-0c7baedefba6b077.js:9 TypeError: Cannot read properties of undefined (reading 'hotel_Nearby_Places_List')