Open nstdspace opened 4 months ago
Hey, could you explain why are you trying to server something from an assets folder?
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