Typescript definitions not working?
See original GitHub issueHey guys!
I’m currently trying to upgrade our project running vue 2.3x to vue 2.5.13 and i can’t make it use VueRessource.
My vue imports and use are declared this way
import Vue from 'vue';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import Vue2Filters from 'vue2-filters';
import { Validator } from 'vee-validate';
import BootstrapVue from "bootstrap-vue";
import VueI18n from 'vue-i18n';
Vue.use(Vue2Filters);
Vue.use(VueResource);
Vue.use(VueRouter);
Vue.use(VueI18n);
Vue.use(infiniteScroll);
Vue.use(BootstrapVue);
But the TS compilation fails with the following error :
(61,9): error TS2345: Argument of type 'typeof "/home/clement/workspace/pingflow/v3/fry/node_modules/vue-resource/types/index"' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
Type 'typeof "/home/clement/workspace/pingflow/v3/fry/node_modules/vue-resource/types/index"' is not assignable to type 'PluginFunction<any>'.
Type 'typeof "/home/clement/workspace/pingflow/v3/fry/node_modules/vue-resource/types/index"' provides no match for the signature '(Vue: VueConstructor<Vue>, options?: any): void'.
I’m running the latest libraries versions : vue@2.5.13 and vue-resource@1.3.6 (double checked in the node_modules) If it’s of any help, i’m using yarn.
Cheers,
Clément
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:11 (1 by maintainers)
Top Results From Across the Web
TypeScript type definitions not working with JavaScript in ...
I'm working on a project with mixed TypeScript and JavaScript. We use ThreeJS, and we use type definitions for it.
Read more >custom typescript definitions not working on windows 10
Here I want to use a package called vueisotope that has no type definition file. To make it work with typescript I changed...
Read more >Go to definition not working with TypeScript
Either after about 10-20 minutes intellisense started working for the typescript project or it never works. There were no errors at all.
Read more >TypeScript: JavaScript With Syntax For Types.
TypeScript is JavaScript with syntax for types. TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at ......
Read more >Importing TypeScript Definitions - C#/XAML for HTML5 - cshtml5
When a TypeScript Definition file is open in a tab in Visual Studio, many misleading errors may be displayed, and some TypeScript code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a temporary workaround, I manually add some declaration to projectRoot/node_modules/vue-resource/types/vue.d.ts:
Using 1.5.1, still can’t access $http or http in Vue.
I have import and use vue-resource in main.ts:
according to vue docs , someone have to do something like:
But vue-resource is not doing something like this, which make $http not accessable from global
Vue
.