Alaa
Alaa
NNuxt
Created by Alaa on 4/29/2025 in #❓・help
Nuxt2 displays wrong meta tags when the page is deleted
Hi everyone! Nuxt2 returns the meta data of the last searched for page when I try to send a page that was deleted, the behaviour is very weird and I have been debugging it all day but with no hope I have two main components one is the welcome component and this component does the fetching as in here
async fetch() {
this.userToken = this.$cookies.get('access_token');
if (this.userToken === '') {
this.userToken = null;
}
try {
const response = await this.$rest.getPageComponets(encodeURIComponent(this.$route.params.username));
this.pageTitle = pageTitle(response.data.data);
....
await this.$store.dispatch('setProfile', profile);
} catch (error) {
const status = error.response?.status || 500;
const message = error.response?.data?.error || 'Unexpected Error!';
const formattedError = new Error(message);
formattedError.statusCode = status;
throw formattedError;
}
},
async fetch() {
this.userToken = this.$cookies.get('access_token');
if (this.userToken === '') {
this.userToken = null;
}
try {
const response = await this.$rest.getPageComponets(encodeURIComponent(this.$route.params.username));
this.pageTitle = pageTitle(response.data.data);
....
await this.$store.dispatch('setProfile', profile);
} catch (error) {
const status = error.response?.status || 500;
const message = error.response?.data?.error || 'Unexpected Error!';
const formattedError = new Error(message);
formattedError.statusCode = status;
throw formattedError;
}
},
7 replies