When you use navigateTo({ name: 'PurchaseError' }), Nuxt (via vue-router) will always resolve the navigation to the route's canonical path, which is the one defined by the path property in your definePageMeta (in your case, /purchase-error/:token?). The alias property only allows the same page to be accessible via additional URLs, but programmatic navigation by route name will always use the main path, not an alias.
There is no built-in way in Nuxt or vue-router to programmatically navigate to an alias path using the route name. If you want to navigate to the alias path, you must specify the path directly in your navigateTo call, like so:
await navigateTo('/purchase/product-error/your-token')
or, if you need to include a dynamic token:
await navigateTo(`/purchase/product-error/${token}`)
Aliases are primarily for allowing users to access the same page via different URLs, not for programmatic navigation by name. This behavior is consistent with vue-router's handling of aliases as well Special Metadata: alias.
I'm sorry, but there's no information in the knowledge sources about a way to make navigateTo({ name: 'PurchaseError' }) resolve to an alias path instead of the canonical path. If you need to navigate to the alias, you must use the path directly.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: