fix(publishVersion): fix maxBodyLength when uploading to appHub #890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
The
maps-app
failed to uploading usingd2-app-scripts publish
. See eg. this run: https://github.com/dhis2/maps-app/actions/runs/11663969768/job/32473530177 .The truncated error made this quite hard to debug - I had to locally run this with a change in
node_modules
of the platform to see the actual error. So I made it dump the error regardless if it's axios-error.The reason it failed was due to
axios
-defaults formaxBodyLength
, which appears to be10MB
. However the server should enforce the length, not the client. The server already does this and is currently configured to allow up to20MB
(ref: https://github.com/dhis2/app-hub/blob/master/server/src/routes/v1/apps/handlers/createAppVersion.js#L36 )Implementation
Adds
maxContentLength: infinity; maxBodyLength: infinity
to hopefully fix this issue.