I'm currently using Typescript along with Webpack. Below is my code snippet. When I run it in Chrome, I encounter the following error:
Uncaught TypeError: vue_1.default is not a constructor
at Object.defineProperty.value (Index.ts:3)
at __webpack_require__ (bootstrap f29fbbb047d131556dcf:19)
at Object.defineProperty.value (bootstrap f29fbbb047d131556dcf:62)
at bootstrap f29fbbb047d131556dcf:62
I have imported the package and added the resolve -> alias -> vue section as well. Despite trying various solutions and experimenting with the tsconfig file, nothing seems to work. Any suggestions on how to resolve this issue?
Below are the contents of webpack.config.js:
Here goes your webpack configuration...
And here's tsconfig.js:
{
"compilerOptions": {
// Compiler options here
},
"exclude": [
"node_modules"
]
}
The index.ts file looks like this:
import Vue from "vue"
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!',
}
})
console.log(app)
In addition, an excerpt of the HTML code used:
<div id="app">
<p>{{ message }}</p>
<input v-model="message">
</div>