Closed tylermatchett closed 4 years ago
This issue keeps coming up... unfortunately this isn't supported on the front end at this time. You'd have to install it into your node server and set something up server side to handle all of the back and forth with your react app. I'm hoping to have an example repo up at some point here soon to show it off, but hopefully this helps. Let me know!
I started trying to do the same thing with create react app and ended up moving over to nextjs.
I have the express part handling the yahoo api calls then fetching the data from the react side of things.
It’s pretty basic at the moment, haven’t tried to do anything crazy, but it all seems to work ok.
I can probably share my code at some point next week. Just need to remove all my keys and clean it up a little.
Ok that makes sense, I ended up just making an express backend to handle it as I wasn't getting the errors that way, similar to both of your suggestions. Thanks for the help.
@regs79 love the idea of using Next! Makes a ton of sense (and would be super fun to use as a way to teach myself next...)
Do you have that code posted anywhere? Would love to check it out!
@whatadewitt I’ll share the repo tomorrow when I’m back near my PC and have cleaned it up a little. 🙂
@whatadewitt, sorry for the delay the code is posted here
Pretty basic. Just a couple of calls in the backend and the corresponding frontend pages. One of them is an example of a dynamic route.
Not entirely sure what I'm going to do with it yet. Just wanted to see if it worked.
Hey, I installed this with npm with a new create-react-app app. the only thing I have included in the project other then the default setup is the line:
const YahooFantasy = require('yahoo-fantasy');
and I get this error:
as well as
So I installed the esm package, but it does not fix anything and I keep getting the above errors.
From the preliminary research I have done, this looks like a webpack issue, conflicting with esm or something, but I really don't know. Any suggestions to get this up and running, I haven't yet figured it out and thought someone might have some suggestions.