zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
104 stars 29 forks source link

Invalid environment error from the API client #2978

Closed eatyourgreens closed 2 years ago

eatyourgreens commented 2 years ago

Package

lib-panoptes-js

Describe the bug

Error: Panoptes Javascript Client Error: Invalid Environment; try setting NODE_ENV to "staging" instead of "development".

This error message is wrong: staging is an invalid value for NODE_ENV. Valid values are production, development or none. See the Webpack mode docs for details

To Reproduce

Make a typo in the env query param eg. ?env=stging.

Expected behavior

The client should ask for a valid Node environment.

eatyourgreens commented 2 years ago

That error message is thrown by the old JS client. I'm not sure why it's showing up on new projects. The auth client, maybe? https://github.com/zooniverse/panoptes-javascript-client/blob/49e3a9e17784f29a09810357a80b6ab84141bd9b/lib/config.js#L65-L68