Router pages time outs issue

@giedrius-grazevicius No problem at all. I don’t know what you guys did but the site is not only fixed but it’s moving faster! :grin:

Thanks much to you and the Wix Code team!

So I am hitting something similar and after some debugging found that the “request” object being passed to my router code is bad.

For example

export function myRouter_Router(request) {
    let tx = request.query['tx'];
}

My custom code is crashing because the first thing it attempts is to get the query parameters. But the request.query is undefined. This was working a few days ago but seems it is broken now. I have also found other objects like the request.referrer being undefined in some case while in other cases it is a valid string.

Could someone on the Wix team explain why the WixRouterRequest object being passed to the custom function has some elements missing ?

Hi,
I am facing the same issue. Is there any solution available?

Sometimes the 500 TIMEOUT error comes, whereas sometimes, it loads the blank template. Can’t figure out on what to do. Please assist!

Are you using any data hooks on your db?

No i am not.

attaching my code for reference:
let globals = {};
globals.product_info= “INITIAL VALUE”

export function products_Router(request) {
// Get item name from URL request
const product_id = request.path[ 0 ];
console.log(product_id);
wixData.get( “products_db” , product_id)
.then((result) => {
globals.product_info = result;
})
console.log( “product_info” , globals.product_info.video)
const seoData = {
title: globals.product_info.product_name,
description: globals.product_info.product_description,
noIndex: false ,
metaTags: {
“og:title” : globals.product_info.product_name
// “og:image”: data.image
}
};

if (globals.product_info) {
return ok( “product-page” , globals.product_info, seoData);
}
// Return 404 if item is not found
return notFound();
}

Please add a new post rather than bumping up an old post from 2018.
Add a link to refer back to this post if needed.