FAQ icon indicating copy to clipboard operation
FAQ copied to clipboard

Improve experience when REACT_APP_PRISMA_SERVICE is missing

Open hgwood opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe.

It has happen to me twice now that I want to setup FAQ, and when I open localhost:3000 in my browser, the loader spins infinitely, there are no errors in any terminal, and I remain confused.

The problem and cause are described in #196. In a nutshell, when the env var REACT_APP_PRISMA_SERVICE is missing in client/.env.local, then the client makes a call to the back-end with an incorrect URL. The back-end responds 200 with HTML but the front-end expects JSON and the parsing fails.

Describe the solution you'd like

I'd like the front-end to check that REACT_APP_PRISMA_SERVICE has a value, and display a nice error if it does not.

hgwood avatar Oct 15 '19 18:10 hgwood

Indeed, that would improve the DX of the project. However, since REACT_APP_PRISMA_SERVICE is only used/needed when in node_env=development, we need to make sure we won't display the error in prod

Errorname avatar Oct 15 '19 19:10 Errorname