-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
What shit is this? I call it in nuxt component in pages dir and SSR mode.
[No active route record was found when calling onBeforeRouteLeave()](vue-router.mjs:35 [Vue Router warn]: No active route record was found when calling
onBeforeRouteLeave()`. Make sure you call this function inside a component child of . Maybe you called it inside of App.vue?)
const activeRecord = inject(matchedRouteKey,
// to avoid warning
{}).value;
if (!activeRecord) {
(process.env.NODE_ENV !== 'production') &&
warn('No active route record was found when calling `onBeforeRouteLeave()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?');
return;
}
registerGuard(activeRecord, 'leaveGuards', leaveGuard);
That cause problem?
[Vue warn]: inject() can only be used inside setup() or functional components.
[log error] TypeError: Cannot read properties of undefined (reading 'modules')
Metadata
Metadata
Assignees
Labels
No labels