A
Alokaiyatharth2704

issue with API call

When I do yarn start it adds undefined to my request url but when I do yarn dev it works fine. Can you guys help me with this issue?
Y
yatharth2704β€’392d ago
@skirianov @rohrig my config object makes this base url for yarn dev { "$bagisto": { "api": {}, "config": { "axios": { "baseURL": "http://192.168.29.159:3000/api/", "headers": {} } } } } and this for yarn start { "$bagisto": { "api": {}, "config": { "axios": { "baseURL": "undefined/api/", "headers": {} } } } }
R
rohrigβ€’392d ago
Hi @Yatharth πŸ‘‹ , how are you defining your baseURL?
Y
yatharth2704β€’392d ago
I don't know where to define my base url I am new to nuxt can you please help
Y
yatharth2704β€’392d ago
Y
yatharth2704β€’392d ago
this is my nuxt.config file module.exports = { integrations: { bagisto: { location: '@vue-storefront/bagisto-api/server', configuration: { api: { url: 'https://bfd4-103-132-59-101.in.ngrok.io' // URL of your e-commerce platform } } } } }; and this is my middleware.config.js I am just providing my backend API endpoint here in middleware.config.js and it works when I do yarn dev but gives above issue when I do yarn start @rohrig
R
rohrigβ€’392d ago
it's there, do you have it defined in your .env ?
Y
yatharth2704β€’392d ago
nope can you give me an example env file? or like what do define here? this was already in the boilerplate code
R
rohrigβ€’392d ago
which boilerplate? can you share the link? you can create a file with .env and inside write
BASE_URL=yourDomain.com
BASE_URL=yourDomain.com
Y
yatharth2704β€’392d ago
yourdomain.com will be my backend server url right?
R
rohrigβ€’392d ago
It will be the URL you use to access your store.
Y
yatharth2704β€’392d ago
oh okay let me try nope the issue still exists
R
rohrigβ€’392d ago
can you create reproduction please?
Y
yatharth2704β€’392d ago
https://auction-dev.ycspl.in/ you can go to this website and when you go to marketplaces and then click weekly just check the network it will give an undefined in between the path
Vue Storefront
Build Setup
Y
yatharth2704β€’392d ago
GitHub
GitHub - vuestorefront/ecommerce-integration-boilerplate: Boilerpla...
Boilerplate for creating new integrations for Vue Storefront Next - open-source frontend for any eCommerce - GitHub - vuestorefront/ecommerce-integration-boilerplate: Boilerplate for creating new i...
R
rohrigβ€’392d ago
I found it. πŸ˜„ What does your route look like? route.js
Y
yatharth2704β€’392d ago
I don't have a route.js file
R
rohrigβ€’392d ago
it's in the template πŸ€”
Y
yatharth2704β€’392d ago
ok even if I create this what do you think the issue is?
R
rohrigβ€’392d ago
I was thinking perhaps you have a var declared in the route that is undefined at runtime. How are you handling routing without the route file?
Y
yatharth2704β€’392d ago
I am simply creating .vue files inside pages directory and it automatically handles the routing for me
Y
yatharth2704β€’392d ago
this is how my folder structure looks like
Y
yatharth2704β€’392d ago
sorry for before this is the exact integration that I am using https://github.dev/vuestorefront/ecommerce-integration-boilerplate
R
rohrigβ€’392d ago
This has been archived
Y
yatharth2704β€’392d ago
so can't I make it work somehow?
R
rohrigβ€’392d ago
I'm sure it's possible. Just making sure you understand that it's archived
Y
yatharth2704β€’392d ago
because when I started working it was not archived Yes but I am like too deep into development here can't go back
R
rohrigβ€’392d ago
got it. I'll try to help you either way. let's start by upgrading the vsf modules:
"@vue-storefront/middleware": "~2.5.4",
"@vue-storefront/nuxt": "~2.5.4",
"@vue-storefront/nuxt-theme": "~2.5.4",
"@vue-storefront/middleware": "~2.5.4",
"@vue-storefront/nuxt": "~2.5.4",
"@vue-storefront/nuxt-theme": "~2.5.4",
I think the current version is 2.7.5 there are a few places you need to update them. Go through each vue-storefront module to make sure they're on the latest version. For context, this has fix issues for others lately. That's why I'm starting with upgrading. πŸ˜„
Y
yatharth2704β€’392d ago
ok let me do this http://192.168.29.159:3000/api/api/bagisto/getProduct now instead of undefined I am getting two api/api like in above url
R
rohrigβ€’392d ago
that's progress of a sort πŸ˜„ check your api calls for a loose "api"
Y
yatharth2704β€’392d ago
{ "api": {}, "config": { "axios": { "baseURL": "http://192.168.29.159:3000/api/api/", "headers": {} } } } I am getting this inside my context object only
R
rohrigβ€’392d ago
πŸ€” have you added an exrta api in the call somewhere ?
Y
yatharth2704β€’392d ago
not anywhere I can find let me check anyways it worked Thank you so much !!πŸ™ @rohrig
R
rohrigβ€’392d ago
Great to hear πŸ˜„ , what was it you changed?
Y
yatharth2704β€’392d ago
version only
R
rohrigβ€’392d ago
πŸ˜„ nice
Want results from more Discord servers?
Add your server
More Posts
getting this error while trying to deployjenkins@ip-172-31-24-212:~/workspace/auction-frontend$ npm install npm WARN read-shrinkwrap This verUnable to access cookies in composablescontext.$bagisto.config.app.$cookies.set('vsf-bagCust-token', loginResult.data.api_access_token); myVSF UI 2 with ecommerce-integration-boilerplateHi, I hope this isn't a silly question :). Is it possible to use the new UI with the boilerplate fouWhat version of Node?Noob question. I was trying to create a storefront with spree and got the following error: error @vuHow to add custom function to a composableimport { Context, useFacetFactory, FacetSearchResult } from '@vue-storefront/core'; import typGet product details and Static block from magento 2 backend to VueStoreFront.Hi, I have a doubt. I need to call static block from magento to vuestorefront homepage someone pleasPossible Memory leak in vuestorefront-apiHi, we are using vuestorefront 1, problem we facing at the moment is that with time the api server iHow to detect if a page has an error inside the layoutInside the default layout I need to detect if there is an error page displayed (like for example a 4Contribution via a specific issueHello. I opened this **issue** (https://github.com/vuestorefront/vue-storefront/issues/6891). I workUnable to change the color of the SFheaderunable to change the background-color of Sf header can someone please helpVSF Redis cache - dynamic parts will be disappeared after a whileHi everybody, we have implemented redis cache with VSF project (SSR Cache), but we faced an issue,Can't we use REST Apis with Vue storefrontIs it necessary to use GraphQl in vuestorefront?Is Bagisto integration with Vue Storefront Deprecated?Please explainWeird url parametersHello πŸ™‚ My Product Id seems whack or not VSF friendly. The are formatted as rest style urls: `"gidSSR Cache - default invalidation handlerAs I saw the previous channel archived, so here we can continue discussion about cache.. @7s @TautvVue Storefront Discord revampDear community! We would like to carry out a complete revamp of our Discord channels and one of th