'cannot GET /PATH error when building NUXT app - DOT in the query params
I have a strange problem in my nuxt app. When ever I run npm run dev everything works. But Once I npm run build and then npm run start I get the problem where I get cannot GET [path of the page here]
I noticed that I get that problem only if I add this query ?verify_url=http%3A%2F%2Fapi.uareacademy.com.au%3A8000%2Fapi%2Femail%2Fverify%2F38%3Fexpires%3D1650449854%26hash%3D09fcd461f0b902db36c51eee9f5ad46782487f70%26signature%3D11b88607ea9664ac3f9792146e88b5130001fe60af5124f00b8cd9da4950afcf in the url. If I remove this query the page loads fine.
I have been trying to find the solution for quite sometime and I'm kinda stuck here. Any help would be highly appreciated.
Thanks
===
EDIT 1: I found what the problem is. Its the dot (.) in the query params api.uareacademy.com.au, i'm figuring out how to fix it. I'll update once done.
EDIT 2: Alright, I fixed it. I needed encode the dot too from the server. here's what I did (using php). Manually replaced the . with %2E which solved the problem
$url = $frontendUrl . '?verify_url=' . urlencode($verifyUrl);
return str_replace('.', '%2E', $url);
EDIT 3: Now even though edit two works on testing mail services like mail trap. It won't work on real time email services like gmail and outlook. Try this instead
return $frontendUrl . '?verify_url=' . str_replace('.', '%2E',urlencode($verifyUrl));
Solution 1:[1]
Alright, I fixed it. I needed encode the dot too from the server. here's what I did (using php). Manually replaced the . with %2E which solved the problem
$url = $frontendUrl . '?verify_url=' . urlencode($verifyUrl);
return str_replace('.', '%2E', $url); // this wont work
return $frontendUrl . '?verify_url=' . str_replace('.', '%2E',urlencode($verifyUrl)); //this works
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


