#@pticon just to confirm, if I send query
1 messages · Page 1 of 1 (latest)
the rewrite should work for path only for what I know so far. The link I've sent was the first thing I've found mentioning the issue you are experiencing.
What are you trying to achieve exactly?
so this thing is as it is
const nextConfig = {
async rewrites() {
return [
{
source: "/joinTeam",
destination: "/",
},
];
},
};
now, I encountered this issue just today. Before this when I had set it up and the days following it, this used to work fine. I send 2 query paramters in the URL itself and I was able to get them on my / route because of the rewrite. But I did not mention them in the config.
Now just today, I saw this feature is broken where a user can come on this link to join a team, based on the query parameters I send. It doesn't matter if I send a query parameter or not, even if I do just /joinTeam, I get a 404 page
how do you send query params?
I don't think you can specify query params on rewrite, rewrite should care only about path. If I type some random query like /joinTeam?x=y, rewrite still works. So the core of the issue must be somwhere else in your case.
I send query params just in the URL itself.
But I agree with you, before when the rewrite was working, then I just used to get error on frontend that the param I am looking for is undefined. But thats coz i did not send the param.
This issue is completely new and should not happen with or without params
I don't think this is really related to query params, as you can basically type anything there and just not use it.
Try to add another rewrite to the array, e.g.:
{
source: "/hello",
destination: "/",
},
Ad than access the path and see what will happend. Unfortunately I don't have any experience with page router
this is weird, even this doesn't work. so strange
Are you using middleware?
like middleware.ts? nope, nothing at all
ok, any issues in console server/client?
my next config other than the above includes sentry and the next bundle analyzer, both of which did not give any issues before this
client side things work smooth, all pages are being rendered and stuff
WAIT
I FOUND IT
sometimes it just helps to turn off the server, remove .next and node_modules, reinstall and rerun. If this does not help, I would start disabling the modules
ok so I did not notice but I was actually working from a branch and not from main
it seems the issue is lazy loading
the branch that I was trying from, has all code related to lazy loading
that I optimised for the app just recently
interesting. Now am wondering why would lazy loading affect routes
anyway good for you, and good to know, this kind of issue
not 100% sure but that was the major thing, couple of other small things I did in optimisation but my biggest code changes were for lazy loading and dynamic. Will need to dig deeper.
yeah true
thank you for your time! 🙌