You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case described above, locally I get a response with the content of x with the response header content-type: text/html. Deployed on Vercel, however, I get an empty response (204). In fact, returning getKeys() instead returns ['x'] locally but an empty array ([]) deployed on vercel.
This seems like a bug to me, so I preferred this example. The original problem I observed was something I cannot reproduce with nitro only: I have a file called x.b64 in a nuxt project. Locally, getItem returns just the content of the file in a string. On vercel I get an object looking like { "0": x, "1": y ...} with as many entries as there are bytes in the file and result[I] = byte at index i.
It seems to me that either vercel or nitro does something weird depending on the file ending, but I don't see exactly what.
Reading a pdf file produces a response with content type text/html but application/pdf on vercel (although the same content).
Where are those inconsistencies coming from?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
I have server assets like pdf templates which I load and modify on the server side on user request. According to examples I found online this is a common approach.
By the way, the fix I found is to use useStorage("assets:server").getItemRaw<string> which is sadly marked as experimental - but it does what I need.
Environment
Node: 20.14.0
Nitro(pack): 2.9.6
Reproduction
npx giget@latest nitro nitro-app --install
server/assets
Reproduction repository, at commit
getKeys() - 7d602f06b3ae2b87cbfdefff5ac58614fa6579f1
Describe the bug
In the case described above, locally I get a response with the content of
x
with the response headercontent-type: text/html
. Deployed on Vercel, however, I get an empty response (204). In fact, returninggetKeys()
instead returns['x']
locally but an empty array ([]
) deployed on vercel.This seems like a bug to me, so I preferred this example. The original problem I observed was something I cannot reproduce with nitro only: I have a file called
x.b64
in a nuxt project. Locally,getItem
returns just the content of the file in a string. On vercel I get an object looking like{ "0": x, "1": y ...}
with as many entries as there are bytes in the file andresult[I] = byte at index i
.It seems to me that either vercel or nitro does something weird depending on the file ending, but I don't see exactly what.
Reading a pdf file produces a response with content type
text/html
butapplication/pdf
on vercel (although the same content).Where are those inconsistencies coming from?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: