tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

[BUG] Cannot build frontend because of Sentry

Open frafra opened this issue 1 year ago • 4 comments

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:

  1. 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.

frafra avatar Oct 29 '23 17:10 frafra

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.

kresp0 avatar Dec 06 '23 12:12 kresp0

@mahesh-naxa does this get fixed with recent docker changes?

ramyaragupathy avatar Apr 17 '24 10:04 ramyaragupathy

@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.

mahesh-naxa avatar Apr 17 '24 11:04 mahesh-naxa

@frafra - can you please try this with the updated docker setup?

ramyaragupathy avatar May 01 '24 03:05 ramyaragupathy