Unhandled Rejection (TypeError): Failed to fetch #456
Unanswered
kiloppertry
asked this question in
Q&A
Replies: 1 comment 4 replies
|
Hey @kiloppertry This is failing because you're passing yahooFinance.historical('TSLA', { period1: '2022-02-01',period2:'today'}); // won't work
yahooFinance.historical('TSLA', { period1: '2022-02-01' ); // will workWe should probably throw a clearer error if pass a string that can't be turned into a date, and I'll track that in #457. |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
import React from "react";
import yahooFinance from 'yahoo-finance2';
const Stocks = () => {
const result = yahooFinance.historical('TSLA', { period1: '2022-02-01',period2:'today'});
console.log(result);
return
};
export default Stocks;
failed:
3 | import yahooFinance from 'yahoo-finance2';
4 |
5 | const Stocks = () => {
All reactions