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
AAlokai
•Created by ALI on 6/28/2024 in #🙋|general-help
Trying to add Storefront UI in nuxt 3
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
AAlokai
•Created by ALI on 1/31/2024 in #🙋|general-help
custom query to change customer password
Hi, I'm trying to change password for an existing cutomer using graphql mutations. I have a vsf2nuxt3 app and I just implemented user authentication. Now, I want to implement change password feature for a user. I am trying
changeCustomerPassword
method from magento sdk.
I am able to change password successfully but graphql returns me the fields that I do not require I want it to return the fields that I have written in my custom query. below is my code:
custom query:
1 replies
AAlokai
•Created by ALI on 11/22/2023 in #🙋|general-help
VSF2-Nuxt3 app integrated with Magento 2.
2 replies
AAlokai
•Created by ALI on 11/21/2023 in #🙋|general-help
Sotring cookies for magento 2 using ```vsf-customer```
I have integrated Magento 2 sdk in my vsf app. For use Authentication, I am using method with custom graphQL query and then I use method to generate Token for authentication. Now, I want to store this token in cookies/localstorage. The documentation suggests that I should use to store cookies because mthods like use token stored in . But, I haven't found any guide related to the usage of this method. Any help on it will be a huge helping hand for me. thanks
2 replies