You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a create react app. I have installed alpaca-trade-api npm module and I try to import alpaca-trade-api in a React Component but I get this error :
Compiled with problems:X
ERROR in ./node_modules/@alpacahq/alpaca-trade-api/node_modules/dotenv/lib/main.js 24:11-24
Module not found: Error: Can't resolve 'fs' in '/Users/vivien/Documents/stock-trading-simulator/client/node_modules/@alpacahq/alpaca-trade-api/node_modules/dotenv/lib'
ERROR in ./node_modules/@alpacahq/alpaca-trade-api/node_modules/dotenv/lib/main.js 26:13-28
Module not found: Error: Can't resolve 'path' in '/Users/vivien/Documents/stock-trading-simulator/client/node_modules/@alpacahq/alpaca-trade-api/node_modules/dotenv/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/urljoin/index.js 20:11-26
Module not found: Error: Can't resolve 'path' in '/Users/vivien/Documents/stock-trading-simulator/client/node_modules/urljoin'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
Do you know why?
Expected Behavior
No response
SDK Version I encountered this issue in
npm install --save @alpacahq/alpaca-trade-api
Steps To Reproduce
create react app
npm i @alpacahq/alpaca-trade-api
add this line to a react component: import Alpaca from '@alpacahq/alpaca-trade-api';
Filled out the Steps to Reproduce section?
I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
@Louvivien I can confirm that this package is designed for backend. I was able to setup a basic express server and then create calls that would import different parts of the alpaca npm package and use them to authenticate, make trades etc.
Once this backend is setup via express you can then use any front end angular/react/vue etc. to make calls to this backend to make trades or turn bots on/off via UI elements in that web app. Hope this adds great context for anyone in the future!
Is there an existing issue for this?
Current Behavior
It is a create react app. I have installed alpaca-trade-api npm module and I try to import alpaca-trade-api in a React Component but I get this error :
Do you know why?
Expected Behavior
No response
SDK Version I encountered this issue in
npm install --save @alpacahq/alpaca-trade-api
Steps To Reproduce
Filled out the Steps to Reproduce section?
Anything else?
No response
The text was updated successfully, but these errors were encountered: