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
{{ message }}
Repository navigation
File upload fails with "Cannot read property 'enableForAnonymousUser' of undefined" #7085
Trying to upload a file (as a logged in user), the request endlessly stales and the server errors with:
parse_1 | (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'enableForAnonymousUser' of undefined
parse_1 | at createHandler (/parse-server/lib/Routers/FilesRouter.js:113:41)
parse_1 | at Layer.handle [as handle_request] (/parse-server/node_modules/express/lib/router/layer.js:95:5)
parse_1 | at next (/parse-server/node_modules/express/lib/router/route.js:137:13)
parse_1 | at /parse-server/lib/middlewares.js:252:7
parse_1 | at runMicrotasks (<anonymous>)
parse_1 | at processTicksAndRejections (internal/process/task_queues.js:93:5)
parse_1 | (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
Steps to reproduce
Get the docker-image (no custom configuration) try to upload a file as a regular user. The promise never finishes.
Actual Outcome
The server error's and the network never responds.
Expected Outcome
The server should accept the upload, store the file and respond
changed the title [-]File upload doesn't work since #7071: Cannot read property 'enableForAnonymousUser' of undefined[/-][+]File upload fails with "Cannot read property 'enableForAnonymousUser' of undefined"[/+]on Dec 19, 2020
Activity
mtrezza commentedon Dec 19, 2020
Thanks for reporting.
I was able to reproduce the issue, a PR is on the way.
The issue is that default values for
fileUploadoptions are not applied.Current workaround is to explicitly set the
fileUploadoptions.[-]File upload doesn't work since #7071: Cannot read property 'enableForAnonymousUser' of undefined[/-][+]File upload fails with "Cannot read property 'enableForAnonymousUser' of undefined"[/+]parseplatformorg commentedon Nov 1, 2021
🎉 This change has been released in version 5.0.0-beta.1
parseplatformorg commentedon Mar 14, 2022
🎉 This change has been released in version 5.0.0