Open SteFlemmer opened 2 years ago
I had this same issue. I was able to resolve it by removing the include
in my ts-loader webpack rule. It seems like excluding node modules in particular causes this to happen. (in your repro example, I can get rid of the TS error if I remove the "exclude" in your js/ts rule, but it causes a bunch of other errors in other node modules. good luck with that one.
I found the real issue. vue-loader tests a dummy file called test.ts
against the webpack rules (presumably to see if typescript compilation is enabled). If this test fails, it apparently doesn't process render functions through the TS compiler. I was able to re-add my normal include
s by adding an include for /^test\.ts$/
, which makes vue-loader happy.
This is, however, super lame. I would consider this a real bug with vue-loader, that you have to have this completely undocumented magic string in your config.
Version
16.8.3
Reproduction link
github.com
Steps to reproduce
What is expected?
Template Loader should not fail to load the vue template part, if it is treated as a .ts file
What is actually happening?
Template Part of vue file is treated as js instead of ts (?)
Versions used