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
I didn't want to file this as a bug/issue in case there is something I'm missing. I've created minimal repro here since it requires you to run both dev server and build: https://github.com/jwhazel/nitro-test
The gist is that if you do something like this to retrieve a file: await useStorage("assets:directory").getItem(fileName), it will always return a string in dev mode. But when running a built application, it seems like it might attempt to do type inference based on the file and will return an array buffer on binary files.
As you can imagine, this created a not-so-fun troubleshooting session this morning when I realized our app wasn't working after deploy. Workaround is to currently check types and apply conditional logic. But for DX reasons, should the type being returned not be consistent between both environments?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I didn't want to file this as a bug/issue in case there is something I'm missing. I've created minimal repro here since it requires you to run both dev server and build: https://github.com/jwhazel/nitro-test
The gist is that if you do something like this to retrieve a file:
await useStorage("assets:directory").getItem(fileName)
, it will always return a string in dev mode. But when running a built application, it seems like it might attempt to do type inference based on the file and will return an array buffer on binary files.As you can imagine, this created a not-so-fun troubleshooting session this morning when I realized our app wasn't working after deploy. Workaround is to currently check types and apply conditional logic. But for DX reasons, should the type being returned not be consistent between both environments?
Beta Was this translation helpful? Give feedback.
All reactions