this error show when I try to fetch some data in nuxtjs
Cannot read property '_normalized' of undefined
This is my axios request in nuxtjs :
async asyncData({app}){
var response = await app.$axios.get('/store/get-services',{params:{id:app.$auth.user.store.id}});
return {services:response.data.services};
}
this is a backend controller laravel:
public function store_ads(Request $req){
if($req->user()->store->id != $req->id){
abort(403);
}
$services = Store::select('id')->with('ads:id,store_id,price,title')->where('id',$req->id)->first();
return response()->json(['services'=>$services],200);
}
and here is how i fetch them in my template:
<div class="services-list">
<h4 class="is-vcentered title has-text-centered has-text-grey-light" v-if="services.ads.length==0">No Services</h4>
<ul>
<li v-for="service in services.ads" :key="service.id"><nuxt-link>{{service.title}}</nuxt-link></li>
</ul>
</div>
What is the reason?
The error was I don't pass to
property for <nuxt-link></nuxt-link>
and this is what causes this error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With