Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Create a Reusable Fetch Function

Fetch errors

I get the following errors, all for line 1: Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation

Failed to load resource: net::ERR_FAILED

port-80-9d4jq94x0a.treehouse-app.com/:1 Uncaught (in promise) TypeError: Failed to fetch

Here is the code:

HTTP://w.trhou.se/5ovp0axudv

1 Answer

Martin Sole
Martin Sole
80,285 Points

Hi

I think the issue is on the click event listener on line 62, you're calling fetch whereas I think you mean to be calling fetchBreedImage