ALI
Explore posts from serversClient Side Rendering
i have a nuxt 3 app, it has following directory structure:
myApp
apps (there are others which I do not think are important to mention)
server -> it has customQueries and src folder and middleware configs among others
web -> it has pages, assets, components, config, sdk, server, layouts, composables, utils etc.
when I run my app with yarn, I run it from inside myApp directory. it runs both the server and the web. that was essentially because we want to utilize power of server and send our magento queries through sdk, which goes through our server to the magento. later, we decided to get rid of sdk and send direct calls to magento and for that we created a function inside web/server directory and added code for JS fetch api, that would be sending calls to the magento url. Now, to use that api, we employed useFetch of nuxt 3 in each composable to send call to the api and then that would call the magento backend. but when I run the code from web directory to bypass the server, nothing happens and no network call is seen, which otherwise would occur even if I use fetch api. how can I fix this?
PS: the method works for homepage banners and messages but it doesn't work of product page. (these are the only places I have implemented it yet).
1 replies
Custom Error page.
Hello everyone! I have built a custom error page but I am also using catch all route. ([...slug].vue). Now, it has become very hard to catch those errors. if i am getting 500 error it will not catch it and display it etc. any advice in the matter is appreciated.
2 replies
Nuxt 3 error handling
I have nuxt 3 app and I am using
catch all
route in my pages
direcotry. Now, for testing purposes I just gave an incorrect baseURL and graphQL URL in my env file for server. I do get 500 status for the category page when I try to open it. but I expect to be redirected to an error page. First I made it the custom error page in the root directory but then for some reason i had to make it a separate component of my own inside components dir. Now, the problem is, my useError composable is undefined in composables/error.vue. so, can not display right message. I have even used error boundaries but still the same problem
~/error.vue and ~/composables/Error/index.vue are same.1 replies
Custom Error Page
Hi, I have created a custom error page and place .vue file in the root directory. Now, whenever there is a page that doesn''t exist; it automatically redirects to error.vue but in the Network tab I still see the status to be 200. it should be 404. help with that please, thanks
'
42 replies