Closed bossanovaorca closed 1 year ago
Hey, are you trying to use this in client-JavaScript in a browser? This is a node-only utility as it stores cached responses to the file system!
If you want to use something like this in the browser, I’d recommend the Fetch API! https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
I am building a site with Lit web components and 11ty, and I would like make a request with eleventy-fetch to feed data into my component. I've tried a few approaches to this, but I am unable to import the cached data in my component. The errors all seem to revolve around lack of default imports/exports in
eleventy-fetch
. Can anyone help me with this issue?11ty JS data file:
web component file: