alpacahq / alpaca-ts

A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.
ISC License
156 stars 42 forks source link

Uncaught (in promise) Error: PageOfTrades parsing failed "Cannot read property 'map' of null" #81

Closed UchihaVeha closed 2 years ago

UchihaVeha commented 2 years ago

Response quotes or trades possibility to be null;

Response:

{"quotes":null,"symbol":"PALT","next_page_token":null}

https://github.com/117/alpaca/blob/b7ff7b5c489df24cd60b2942968a2f97bfefdfae/src/parse.ts#L273

Screenshot from 2021-10-01 14-37-52

117 commented 2 years ago

So Alpaca is returning null instead of an empty array?... strange.

117 commented 2 years ago

Resolved for Quotes, Trades and Bars in version ^6.3.6.