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 have a static file that I want to load into the client side at startup e.g.test.json. I have a plugin on the app:beforemount hook in Nuxt.
I place my file in the public folder and I can therefore load the file into the app e.g. fetch('/test.json')
This all works in dev. I am putting my nuxt app into a container. With the build container I want to be able to change test.json when I run the container. So I use docker run -v to replace the 'test.json' inside the container with one I supply. Now when my client app calls fetch('/test.json') its does get the replaced content but the content-length is incorrect and hence i get a Content_Length_Mismatch error in the browser.
It seems, from the docs, the content-length is coming from meta data ascertained at build time. Is there any way to override this behaviour so the content-length is correctly set at runtime from the content rather than from the metadata?
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 have a static file that I want to load into the client side at startup e.g.test.json. I have a plugin on the app:beforemount hook in Nuxt.
I place my file in the public folder and I can therefore load the file into the app e.g. fetch('/test.json')
This all works in dev. I am putting my nuxt app into a container. With the build container I want to be able to change test.json when I run the container. So I use docker run -v to replace the 'test.json' inside the container with one I supply. Now when my client app calls fetch('/test.json') its does get the replaced content but the content-length is incorrect and hence i get a Content_Length_Mismatch error in the browser.
It seems, from the docs, the content-length is coming from meta data ascertained at build time. Is there any way to override this behaviour so the content-length is correctly set at runtime from the content rather than from the metadata?
Beta Was this translation helpful? Give feedback.
All reactions