meowcat_32
meowcat_32
NNuxt
Created by meowcat_32 on 2/22/2025 in #❓・help
nuxt ui use button as regular link
to and href both use NuxtLink!! what do i do?
4 replies
NNuxt
Created by meowcat_32 on 2/22/2025 in #❓・help
in nuxt, where do i specify the context's types?
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig();

const session_id = getCookie(event, 'session_id');
let ctx: SessionContext | null = null;

if (session_id) {
const s: SessionContext = await validateSession(session_id);
if (s.user === null) {
deleteCookie(event, 'session');
}
}
// how do i access this within my nuxt app?
// this is only on the server side right?
event.context.session = ctx;

if (!ctx && config.authRoutes.includes(event.path)) {
sendRedirect(event, '/login', 302);
}
});
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig();

const session_id = getCookie(event, 'session_id');
let ctx: SessionContext | null = null;

if (session_id) {
const s: SessionContext = await validateSession(session_id);
if (s.user === null) {
deleteCookie(event, 'session');
}
}
// how do i access this within my nuxt app?
// this is only on the server side right?
event.context.session = ctx;

if (!ctx && config.authRoutes.includes(event.path)) {
sendRedirect(event, '/login', 302);
}
});
in nuxt, where do i specify the context's types?
17 replies
NNuxt
Created by meowcat_32 on 2/13/2025 in #❓・help
cant install @tanstack/vue-query?
npm i @tanstack/vue-query :snowflake: shell
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: nuxt-app@undefined
npm error Found: [email protected]
npm error node_modules/vue
npm error peer vue@">=3" from @iconify/[email protected]
npm error node_modules/@iconify/vue
npm error @iconify/vue@"^4.2.0" from @nuxt/[email protected]
npm error node_modules/@nuxt/icon
npm error @nuxt/icon@"^1.10.3" from the root project
npm error peer vue@"^3.3.4" from @nuxt/[email protected]
npm error node_modules/@nuxt/vite-builder
npm error @nuxt/vite-builder@"3.15.4" from [email protected]
npm error node_modules/nuxt
npm error nuxt@"^3.15.4" from the root project
npm error 14 more (@radix-icons/vue, @tanstack/vue-virtual, @unhead/vue, ...)
npm error
npm error Could not resolve dependency:
npm error @tanstack/vue-query@"*" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/vue
npm error peer vue@">= 2.5 < 2.7" from @vue/[email protected]
npm error node_modules/@vue/composition-api
npm error peerOptional @vue/composition-api@"^1.1.2" from @tanstack/[email protected]
npm error node_modules/@tanstack/vue-query
npm error @tanstack/vue-query@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/bea/.npm/_logs/2025-02-13T23_49_48_949Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/bea/.npm/_logs/2025-02-13T23_49_48_949Z-debug-0.log
npm i @tanstack/vue-query :snowflake: shell
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: nuxt-app@undefined
npm error Found: [email protected]
npm error node_modules/vue
npm error peer vue@">=3" from @iconify/[email protected]
npm error node_modules/@iconify/vue
npm error @iconify/vue@"^4.2.0" from @nuxt/[email protected]
npm error node_modules/@nuxt/icon
npm error @nuxt/icon@"^1.10.3" from the root project
npm error peer vue@"^3.3.4" from @nuxt/[email protected]
npm error node_modules/@nuxt/vite-builder
npm error @nuxt/vite-builder@"3.15.4" from [email protected]
npm error node_modules/nuxt
npm error nuxt@"^3.15.4" from the root project
npm error 14 more (@radix-icons/vue, @tanstack/vue-virtual, @unhead/vue, ...)
npm error
npm error Could not resolve dependency:
npm error @tanstack/vue-query@"*" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/vue
npm error peer vue@">= 2.5 < 2.7" from @vue/[email protected]
npm error node_modules/@vue/composition-api
npm error peerOptional @vue/composition-api@"^1.1.2" from @tanstack/[email protected]
npm error node_modules/@tanstack/vue-query
npm error @tanstack/vue-query@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/bea/.npm/_logs/2025-02-13T23_49_48_949Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/bea/.npm/_logs/2025-02-13T23_49_48_949Z-debug-0.log
first time i got a dependency error, can i just ignore it? i think tanstack query uses a outdated version of composition api or something..
19 replies