Lennox
Lennox
NNuxt
Created by Lennox on 4/1/2025 in #❓・help
Validation of Form File Inputs (ui3)
@kapa.ai there is NO documentation on validating this and i only get {file:undefined} as a result of my states in validate.
const validate = (state: any): FormError[] => {
console.log(state)
const errors = [];
if (!state.file) errors.push({ name: "file", message: "Pflichtfeld" });
console.log(state);
return errors;
};
const validate = (state: any): FormError[] => {
console.log(state)
const errors = [];
if (!state.file) errors.push({ name: "file", message: "Pflichtfeld" });
console.log(state);
return errors;
};
<UForm
:validate="validate"
:validate-on="['change']"
:state="state"
class="space-y-4"
@submit="onSubmit"
>
<UFormField
label="Datei"
description="Nur .pdf, .png und .jpeg Dateien sind erlaubt"
name="file"
required
>
<UInput
type="file"
accept="image/png,.png,image/jpeg,.jpg,.jpeg,application/pdf,.pdf"
/>
</UFormField>
<UForm
:validate="validate"
:validate-on="['change']"
:state="state"
class="space-y-4"
@submit="onSubmit"
>
<UFormField
label="Datei"
description="Nur .pdf, .png und .jpeg Dateien sind erlaubt"
name="file"
required
>
<UInput
type="file"
accept="image/png,.png,image/jpeg,.jpg,.jpeg,application/pdf,.pdf"
/>
</UFormField>
9 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
@kapa.ai does the approach with the watcher work thru multiple tabs? Example: In tab A i have the profile page where I press logout and in tab B I've got the dashboard page. Both are password protected.
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
@kapa.ai can you reqwrite my plugin to make use of "auth: true" from the definePageMeta?
export default defineNuxtPlugin(() => {
const { loggedIn } = useUserSession();

watch(loggedIn, (isLoggedIn) => {
let path = window.location.pathname;
if (
isLoggedIn ||
path === "/login" ||
path.startsWith("/api") ||
path.startsWith("/_")
)
return;
navigateTo("/login");
});
});
export default defineNuxtPlugin(() => {
const { loggedIn } = useUserSession();

watch(loggedIn, (isLoggedIn) => {
let path = window.location.pathname;
if (
isLoggedIn ||
path === "/login" ||
path.startsWith("/api") ||
path.startsWith("/_")
)
return;
navigateTo("/login");
});
});
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
@kapa.ai can you reqwrite my plugin?
export default defineNuxtPlugin(() => {
const { loggedIn } = useUserSession();

watch(loggedIn, (isLoggedIn) => {
let path = window.location.pathname;
if (
isLoggedIn ||
path === "/login" ||
path.startsWith("/api") ||
path.startsWith("/_")
)
return;
navigateTo("/login");
});
});
export default defineNuxtPlugin(() => {
const { loggedIn } = useUserSession();

watch(loggedIn, (isLoggedIn) => {
let path = window.location.pathname;
if (
isLoggedIn ||
path === "/login" ||
path.startsWith("/api") ||
path.startsWith("/_")
)
return;
navigateTo("/login");
});
});
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
@kapa.ai the problem is, that I don't want the plugin to acess every page but only on those where my auth middleware is loaded. can I somehow define custom pageMeta and require those for a page to redirect on load/thru the plugin?
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
@kapa.ai Do plugins and middleware only work on the /pages-folder?
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
I think i broke it
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
wtf
42 replies
NNuxt
Created by Lennox on 3/27/2025 in #❓・help
Auth middleware not redirecting
@kapa.ai how can i make use of a watch? Because if someone loggs out they shoudn't see the page INSTANTLY
42 replies
NNuxt
Created by Lennox on 3/25/2025 in #❓・help
Limit deployments
@kapa.ai * i mean that it automaticly deletes old deployments
8 replies
NNuxt
Created by Lennox on 3/13/2025 in #❓・help
Transition of drawer state
@kapa.ai no, it should just animate the size of the wrapper inside the body
11 replies
NNuxt
Created by Lennox on 3/12/2025 in #❓・help
Vite-PWA
@kapa.ai there seems to be a service worker, but chrome aswell as the html dom doesn't display any information of a manifest
23 replies
NNuxt
Created by Lennox on 3/12/2025 in #❓・help
Vite-PWA
<VitePwaManifest /> imports as: <!-- MANIFEST --> <!----> <!-- END OF MANIFEST --> @kapa.ai
23 replies
NNuxt
Created by Lennox on 3/12/2025 in #❓・help
Vite-PWA
@kapa.ai my pwa doesn't even work
23 replies
NNuxt
Created by Lennox on 3/12/2025 in #❓・help
Vite-PWA
@kapa.ai any alternatives?
23 replies
NNuxt
Created by Lennox on 3/11/2025 in #❓・help
GitHub Action - Deploy to NuxtHub
solved - i've added the following lines to my package.json:
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.35.0",
"@tailwindcss/oxide-linux-x64-gnu": "4.0.13",
"lightningcss-linux-x64-gnu": "1.29.2"
}
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.35.0",
"@tailwindcss/oxide-linux-x64-gnu": "4.0.13",
"lightningcss-linux-x64-gnu": "1.29.2"
}
seems like a bit janky solution but it works for now. let me know if someone has a better workaround.
10 replies
NNuxt
Created by Lennox on 3/11/2025 in #❓・help
GitHub Action - Deploy to NuxtHub
@kapa.ai ##[group]Run actions/setup-node@v4 with: node-version: 22 cache: npm always-auth: false check-latest: false token: *** ##[endgroup] Found in cache @ /opt/hostedtoolcache/node/22.14.0/x64 ##[group]Environment details node: v22.14.0 npm: 10.9.2 yarn: 1.22.22 ##[endgroup] [command]/opt/hostedtoolcache/node/22.14.0/x64/bin/npm config get cache /home/runner/.npm ##[warning]Cache not found for keys: node-cache-Linux-x64-npm-7c35e7e7cb5332a46f43337d471ae417e36fd87ef68e9744a3c4ccc66beeb151 npm cache is not found ##[group]Run npm install npm install shell: /usr/bin/bash -e {0} ##[endgroup] > postinstall > nuxt prepare [error] Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory. at requireWithFriendlyError (node_modules/rollup/dist/native.js:64:9) at Object.<anonymous> (node_modules/rollup/dist/native.js:73:76) at Module._compile (node:internal/modules/cjs/loader:1554:14) at Object..js (node:internal/modules/cjs/loader:1706:10) at Module.load (node:internal/modules/cjs/loader:1289:32) at Function._load (node:internal/modules/cjs/loader:1108:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:220:24) at cjsLoader (node:internal/modules/esm/translators:262:5) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7) [cause]: Cannot find module '@rollup/rollup-linux-x64-gnu' Require stack: - /home/runner/work/[REDACTED]/[REDACTED]/node_modules/rollup/dist/native.js Require stack: - node_modules/rollup/dist/native.js at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15) at Function._load (node:internal/modules/cjs/loader:1055:27) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:220:24) at Module.require (node:internal/modules/cjs/loader:1311:12) at require (node:internal/modules/helpers:136:16) at requireWithFriendlyError (node_modules/rollup/dist/native.js:46:10) at Object.<anonymous> (node_modules/rollup/dist/native.js:73:76) at Module._compile (node:internal/modules/cjs/loader:1554:14) at Object..js (node:internal/modules/cjs/loader:1706:10) [error] Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory. npm error code 1
10 replies
NNuxt
Created by Lennox on 3/10/2025 in #❓・help
z-index glitch
solved- i think it was because of the sticky tag. i dont know why tho.
12 replies
NNuxt
Created by Lennox on 3/10/2025 in #❓・help
z-index glitch
Bump
12 replies
NNuxt
Created by Lennox on 3/10/2025 in #❓・help
z-index glitch
someone please help :/
12 replies