Bug Description
The photon spectrum lines command fails with "H.map is not a function" on all CLI versions (0.3.3 through 1.1.0). The API returns valid JSON {"lines":[], "pendingRegistrations":[]}, but the minified response handler code expects H to be an array and calls .map() on it.
Steps to Reproduce
export PHOTON_PROJECT_ID=<any-project-id>
photon spectrum lines
# # H.map is not a function
Environment
- OS: macOS
- Node: v22.23.1
- CLI Version: 1.1.0 (also reproduced on 0.3.3, 0.4.0, 1.0.0)
- API Response: {"lines":[], "pendingRegistrations":[]} (HTTP 200)
Root Cause
The minified photon.js file contains response handling logic for spectrum lines list where a variable H holds the API response object. The code then does H.map(...) expecting H to be an array, but H is the full response object {lines: [], pendingRegistrations: []}. The array is in H.lines not H itself.
Workaround
Direct API call via curl works fine:
curl "https://app.photon.codes/api/projects/$PHOTON_PROJECT_ID/lines" \
-H "Authorization: Bearer $TOKEN"
# {"lines":[], "pendingRegistrations":[]}
Bug Description
The
photon spectrum linescommand fails with "H.map is not a function" on all CLI versions (0.3.3 through 1.1.0). The API returns valid JSON {"lines":[], "pendingRegistrations":[]}, but the minified response handler code expects H to be an array and calls .map() on it.Steps to Reproduce
Environment
Root Cause
The minified photon.js file contains response handling logic for
spectrum lines listwhere a variable H holds the API response object. The code then does H.map(...) expecting H to be an array, but H is the full response object {lines: [], pendingRegistrations: []}. The array is in H.lines not H itself.Workaround
Direct API call via curl works fine: