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

CORS Paper mode issue? #101

Closed dimitri-deychak closed 2 years ago

dimitri-deychak commented 2 years ago

Description CORS policy error when using API on Paper mode

Expected Works as normal

Reproduction Steps we can take to reproduce the bug:

  1. Use paper: true and add paper keys to constructor

Logs Screen Shot 2022-04-02 at 5 52 54 PM

Additional Am I doing something wrong here? I am developing my system and want to utilize the paper account for testing runs. But I am not able to use any features since I am getting this CORS policy - I don't get it when using non-paper mode.

117 commented 2 years ago

In your fetch have you tried adding mode: 'no-cors',?

117 commented 2 years ago

You may need to bypass CORS for your localhost application with an extension like https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/.

117 commented 2 years ago

This is not the case if you run it without the browser.

dimitri-deychak commented 2 years ago

Thanks, makes sense.

Manas-Nagelia commented 1 year ago

In production, how will we prevent the CORS error? And in development, are you saying to use the browser extension to bypass the error?