Viridian
Viridian
Explore posts from servers
NNuxt
Created by Viridian on 9/2/2024 in #❓・help
Retrieve error status code and display error on page
setResponseStatus doesn't seem to work either;
Effect.fail(setResponseStatus(event, e.response.status, "Something went wrong. Please try again later.")),
Effect.fail(setResponseStatus(event, e.response.status, "Something went wrong. Please try again later.")),
This actually does change the statusText, but not the status itself. I can confirm e.response.status is 404 as well indeed.
[Vue warn]: Unhandled error during execution of native event handler
at <Input modelValue="ixmqwoixwmq" onUpdate:modelValue=fn name="search" ... >
at <Container>
at <App key=4 >
at <NuxtRoot>
[Vue warn]: Unhandled error during execution of native event handler
at <Input modelValue="ixmqwoixwmq" onUpdate:modelValue=fn name="search" ... >
at <Container>
at <App key=4 >
at <NuxtRoot>
I see this as well.
3 replies
NNuxt
Created by Viridian on 9/2/2024 in #❓・help
Retrieve error status code and display error on page
I tried doing this:
const data = await $fetch<PlayerSearchResult>("/api/account", {
method: "post",
body: { player: search.value, region: region.value },
onResponseError: (e) => {
console.log("ERROR FOUND: ", e);
}
});
const data = await $fetch<PlayerSearchResult>("/api/account", {
method: "post",
body: { player: search.value, region: region.value },
onResponseError: (e) => {
console.log("ERROR FOUND: ", e);
}
});
And it logs the error, but the status seems to be 500 instead of the 404 that I am trying to make it have
3 replies
NNuxt
Created by Viridian on 9/1/2024 in #❓・help
Expand tooltip content (NuxtUI)
That works, you're a legend @Antonio Ivanov 🙏
4 replies
NNuxt
Created by Viridian on 9/1/2024 in #❓・help
Expand tooltip content (NuxtUI)
No description
4 replies
NNuxt
Created by Viridian on 8/23/2024 in #❓・help
Unable to get logs from Event pipe in defineEventHandler
Fixed it, it was something stupid. We're parsing stuff wrong 🤣
2 replies
NNuxt
Created by Viridian on 8/22/2024 in #❓・help
Use incoming event type in defineEventHandler
I can tell it works with Zod though
9 replies
NNuxt
Created by Viridian on 8/22/2024 in #❓・help
Use incoming event type in defineEventHandler
as decodeUnknownSync and similar from Effect normally returns an Effect (in this case, it would be an Effect with either T or ParseError), I was curious
9 replies
NNuxt
Created by Viridian on 8/22/2024 in #❓・help
Use incoming event type in defineEventHandler
I assume readValidatedBody doesn't have the result of the parsing as its return type but rather just a Promise? Right now, it's returning Promise<T>
9 replies
NNuxt
Created by Viridian on 8/22/2024 in #❓・help
Use incoming event type in defineEventHandler
I ask because I'm doing some stuff with Effect and trying to make things work:
const validateBody = <T>(schema: S.Schema<T>) => async (event: H3Event<EventHandlerRequest>) =>
await readValidatedBody(event, S.decodeUnknownSync(schema))
const validateBody = <T>(schema: S.Schema<T>) => async (event: H3Event<EventHandlerRequest>) =>
await readValidatedBody(event, S.decodeUnknownSync(schema))
9 replies
NNuxt
Created by Viridian on 8/22/2024 in #❓・help
Use incoming event type in defineEventHandler
Ah, that works? Solid
9 replies
NNuxt
Created by Viridian on 6/12/2024 in #❓・help
DeprecationWarning when building with nuxt-icon
I would appreciate any input on the matter!
7 replies
NNuxt
Created by Viridian on 6/12/2024 in #❓・help
DeprecationWarning when building with nuxt-icon
No description
7 replies
NNuxt
Created by Viridian on 6/12/2024 in #❓・help
DeprecationWarning when building with nuxt-icon
Removing the highlighted line in node_modules/@iconify/vue/package.json seems to make the deprecation warnings disappear, but I do not know if this is a good way to go about it.
7 replies
NNuxt
Created by Viridian on 6/11/2024 in #❓・help
Property 'body' does not exist on type '{}'
Fixed it, the file itself had to be account.post.ts
3 replies
NNuxt
Created by Viridian on 6/11/2024 in #❓・help
Property 'body' does not exist on type '{}'
I might be missing some basic stuff here, as I'm trying to refresh my Nuxt skills, so do let me know if I missed something!
3 replies