MicrosoftDocs / mslearn-build-api-azure-functions

MSLearn exercise code
MIT License
24 stars 59 forks source link

Front End not showing API data #13

Closed rjb7731 closed 1 year ago

rjb7731 commented 2 years ago

Noticed when doing the tutorial that the front end does not show 'Get Error: Network Failed' as shown in the example but instead shows 'Loading..' and the brand section has the following {{ product.brand.name }} It doesn't appear to load the data from the API later in the tutorial either when doing a page refresh.

EDIT: I got the app functioning by changing the script pointing to vue3 back to vue2 within index.html. I'm assuming this is an issue with some conflict in the code between vue2 and vue3? Might dig a bit deeper when i understand vue/js better if this cant be resolved by anyone

Line I added in index.html:

RebelMoogle commented 2 years ago

Thank you for adding this, I was able to run it that way.

davidpetric commented 2 years ago

Thank you rjb7731!

trotin commented 2 years ago

Now the default version of Vuejs is the Vue 3. If the version number isn't specified, the cdn link ( https://cdn.jsdelivr.net/npm/vue ) is the last stable version which is target (3.x). The current instantiation code on Vue application in the index.js file doesn't work on Vue 3. So the frontend doesn't work anymore.

The quick way to solve is updating the cdn link in the index.html to target Vue2 : https://cdn.jsdelivr.net/npm/vue@2

I hope it can be helpful

Baso1st commented 2 years ago

@nickwalkmsft