Josh Deltener
Is there a way to NOT show an HTML error from an API?
The recommended way of handling errors in Nitro/API-land is to use
createError
. When hit directly, these show a full html error page, or if hit with accept: application/json
, show a json payload with stack info.
I'd like to return a simple message on-error vs all that. It would seem the only option I have is to use setResponseStatus
and return whatever
directly from the api vs passing something to createError
.
IMHO, no matter what, an api shouldn't be returning full page html errors.8 replies
What's the right way to install Pinia?
The docs say to install
pinia @pinia/nuxt
, but @pinia/nuxt
already has pinia
as a dep.. (and we've been just using that for months)
https://github.com/vuejs/pinia/blob/v2/packages/nuxt/package.json#L50
We're moving from yarn
to npm
and just noticed this diff. So are the install docs outdated, or is there another reason we're supposed to install pinia
by itself along with @pinia/nuxt
?6 replies
File hashes change even when contents doesn't
We've been noticing when using Nuxt3/Vite, every time a build is created, all filenames change even if nothing has changed. Is this a
vite
? thing or a Nuxt thing? Is there any way around it? With Nuxt 2/Webpack the filenames didn't change if something didn't change so cache-hit ratios and website stability was better.1 replies