question

SakshiSrirangam-4385 avatar image
1 Vote"
SakshiSrirangam-4385 asked FrdricOGUER-7121 edited

Getting Uncaught TypeError: Vue is not a constructor while running the Tailwind Traders project

Getting Uncaught TypeError: Vue is not a constructor while running the Tailwind Traders project which is mentioned in the "Build Serverless APIs with Azure Functions" learning module. Due to this, after the complete setup, the page is not showing the data.
How can this be resolved?
''

185413-image.png


I also tried importing vue like this(changes in the first 2 lines):
import Vue from 'vue';
var foo = (function () {
(I then call foo(); in the end)
but I got the following error:
185386-image.png

Appreciate some help on this.

azure-functionsazure-webapps-apis
image.png (1.7 MiB)
image.png (1.7 MiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @SakshiSrirangam-4385 - I was able to clone, and run 'npm start' successfully to get the Vue.js based frontend up and running without any issues. Did you happen to have any pre-existing installation of VueJS on your machine? I'm not too familiar with VueJS but a quick search yields that the issue might be due to v2 vs v3 instantiations of VueJS: https://stackoverflow.com/questions/67198389/vue-is-not-defined-not-a-constructor

0 Votes 0 ·

1 Answer

FrdricOGUER-7121 avatar image
3 Votes"
FrdricOGUER-7121 answered FrdricOGUER-7121 edited

In the index.html file, force the VueJS version to 2, line 11 :

 <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0"></script>




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.