tasking-manager
tasking-manager copied to clipboard
[BUG] Cannot build frontend because of Sentry
Describe the bug
npm run build
fails with caused by: sentry reported an error: Authentication credentials were not provided. (http status: 401)
.
To Reproduce Steps to reproduce the behavior:
- Build frontend
Expected behavior Sentry credentials should be read at runtime, not at build time.
Additional information
I think this happens because npm build
runs sentry:sourcemaps
:
https://github.com/hotosm/tasking-manager/blob/d560a76933de8c40c1022b9f31248520a3987148/frontend/package.json#L96
It really looks an action that should not be called on build, since it contains HOT-specific configuration, which is not relevant for other setups of the TM.
Regression have been caused by b7563bf713687b86997a56d316e547ba13f6a831.
I can also reproduce this issue.
After removing line 96, the comma and the end of line 95 and && npm run sentry:sourcemaps
, the build finishes without the error.
@mahesh-naxa does this get fixed with recent docker changes?
@ramyaragupathy the new docker compose has frontend setup as per the frontend/Dockerfile_development
, so npm start
is performed.
I believe npm run sentry:sourcemaps
is needed for production setup only and if its to be used, the environment var SENTRY_AUTH_TOKEN
should have been set accordingly.
The current docker setup will not produce this error.
@frafra - can you please try this with the updated docker setup?