xergic
xergic
NNuxt
Created by Stefan on 6/21/2024 in #❓・help
Typescript types for server errors
You should use FetchError (from ofetch) instead of Error when checking instanceof.
3 replies
NNuxt
Created by Prem on 6/20/2024 in #❓・help
`$fetch` error handling.
import { FetchError } from 'ofetch'

try {
await $fetch("/api/auth/login", {
method: "POST",
body: data
});
} catch (error) {
if (error instanceof FetchError) {
console.log(error.response?._data)
}
}
import { FetchError } from 'ofetch'

try {
await $fetch("/api/auth/login", {
method: "POST",
body: data
});
} catch (error) {
if (error instanceof FetchError) {
console.log(error.response?._data)
}
}
3 replies
NNuxt
Created by mhladnik on 4/26/2024 in #❓・help
Create global instance of ofetch
3 replies
NNuxt
Created by lasroun on 4/22/2024 in #❓・help
Deploy Nuxt 3 in dokku
What buildpack do you use? Maybe you're missing Procfile (file in your root, Heroku uses this) with content like:
web: node .output/server/index.mjs
web: node .output/server/index.mjs
3 replies