When i run yarn run watch (inside my laravel project root) it compiles with no errors. However if i edit a file afterwards it show an error in the terminal for every single .ts file in my resources folder. Typescript in .vue files has no issues. Also note that every change i make seems to be compiled as well, so in other words, it works... but the error messages stay in the console.
The error i am getting for each .ts file is:
TS2307: Cannot find module '!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js' or its corresponding type declarations.
This file does exist inside my node_module folder.
I have googled it an the only thing i found remotely close to my problem is this link: https://github.com/vuejs/vue-loader/issues/634
But none of the suggested solution/workarounds there work for me.
This is my tsconfig
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
},
"include": [
"resources/js/**/*"
],
"exclude": [
"vendor",
]
}
I suspect it is either a configuration issue or a version problem in ts-loader or vue-loader.
"ts-loader": "^8.2.0",
"typescript": "^4.3.2"
"vue-loader": "^15.7.0",
webpack config:
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {appendTsSuffixTo: [/\.vue$/]},
exclude: /node_modules/
},
]
},
resolve: {
extensions: ["*", ".js", ".jsx", ".vue", ".ts", ".tsx"]
}
Keep in mind i have to use 8.2. in order for laravel-mix to be able to work with it. Also i use vue-class-components and vue-property-decator