#Navigate to 404 page from [...slug.vue]

2 messages · Page 1 of 1 (latest)

latent quarry
#

I'm using the following conditional createError block in my [...slug].vue to try and trigger navigation to my error.vue, but it doesn't navigate. Instead, it shows errors in the console and stays on the current page.

if (certainConditions === false) {
  throw createError({
    statusCode: 404,
    message: `Could not find content with route “${route.fullPath}”`,
    fatal: true,
  });
}

Console:

[Vue warn]: Unhandled error during execution of setup function

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core 

Error: Could not find content with route “/random-slug”

Uncaught (in promise) Error: Could not find content with route “/random-slug”

Any tips?

latent quarry
#

Bump 😄