Open JohnLouderback opened 7 years ago
Have you figured this out? I'm running into this issue as well. Vue is undefined
. I can get past that issue if I do import * as Vue from 'vue'
. However, my Test component would be undefined
.
I followed the guide here regarding Vue + Typescript. Adding allowSyntheticDefaultImports
to .compilerc
should allow me to simply write import Vue from 'vue'
but it doesn't seem to work. I'm not sure if electron-compile is honoring that flag in the config. The linked documented parameters for Typescript does not have that flag.
Any updates on this?
FYI I had the exact same issue until I noticed in the link from @jandauz that the recommended module type in tsconfig is es2015. I was using commonjs previously. After switching to es2015 and fixing up a couple of import statements it all works as expected.
I started with electron-forge's Vue template and went ahead and added TypeScript to it. It mostly works, but I keep getting an error when running the TypeScript within the Vue Component File
For this line:
This is derived from this Vue file:
It seems to believe that
Vue
isn't defined. Using this same import line in theindex.html
file works flawlessly:I did notice that, however, in its own
.ts
file, the code still will fail with the same error:I've been scratching my head over this one and I'm at a total loss.
For what it's worth, these are my dependencies and devDependencies:
Edit: I also noticed changing my
target
for TypeScript in the.compilerc
file toES5
did not change anything at all. Maybe the issue is that my TypeScript settings are being ignored?