Open lorriman opened 7 years ago
By the way, I didn't use the https://github.com/DanielRosenwasser/vue#540a38fb21adb7a7bc394c65e23e6cffb36cd867
Sorry, the assumption I've used uses the .d.ts
files in that repo and I'm not going to be able to diagnose the problem otherwise. I expect that eventually those changes will make their way into Vue itself, but in the mean time I can't give a lot of guidance.
The behavior of needing synthetic default imports is expected though, since you might not have a more recent change made to .d.ts
files.
Any chance of some words on getting debugging working from VSCode?
Maybe this is something I could look into down the road.
Hi, no worries. I was just writing up from the perspective of a total newbie, which might be of interest to you. I see now the default issue is actually already addressed in the downloadable code, but I had been following the guide with copy and paste, and in the guide there was no 'allowSyntheticDefaultImports' in the config.
I've also worked out debugging for myself using VScode, which does seem to make it simple. Perhaps I should write it up and send that to you for your interest (again, since it comes from such a newbie). I realise that it's really off-topic, but if it constitutes a one line addition to the guide, it could add some worthwhile value for some of your readers at minimal distraction, especially since the guide is of perhaps the highest value to people like me.
I doubt I would have been able to start on a typescript/vue project otherwise, and my progress in to typescript with a practical framework, and so almost immediate productivity, is therefore hugely accelerated.
Thanks to all involved.
"npm run build" results in
"error TS1192: Module '"myabsolutepath/test_chrome_ext_typescript/node_modules/vue/types/index"' has no default export."
Being a complete beginner to webpack/npm/typescript, and not much experience in javascript, I eventually googled a solution to be
import * as Vue from "vue";
in the index.ts file. This built. It results in the browser console giving:
"Uncaught TypeError: WEBPACK_IMPORTED_MODULE_0_vue is not a function"
In the end I had to include "allowSyntheticDefaultImports": true in tsconfig.json compiler options. which was the final fix and and works with the original import statement.
By the way, I didn't use the https://github.com/DanielRosenwasser/vue#540a38fb21adb7a7bc394c65e23e6cffb36cd867
as being irrelevant to a basic skeleton and a potential problem; plus not comprehensible to a newbie. I merely 'npm install vue'.
Also my typescript install is global. Everything else was as given in the guide.
Any chance of some words on getting debugging working from VSCode?