Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

typescript declaration error, vue has no default export #13

Closed
agentschmitt opened this issue Mar 22, 2017 · 2 comments
Closed

typescript declaration error, vue has no default export #13

agentschmitt opened this issue Mar 22, 2017 · 2 comments

Comments

@agentschmitt
Copy link
Contributor

After updating from version 3.4 to 4.0 i am getting type script errors.

ERROR in node_modules\vue-class-component\lib\declarations.d.ts
(1,8): error TS1192: Module '"node_modules/vue/types/index"' has no default export.
ERROR in node_modules\vue-class-component\lib\index.d.ts
(1,8): error TS1192: Module 'node_modules/vue/types/index"' has no default export.
ERROR in node_modules\vue-property-decorator\lib\vue-property-decorator.d.ts
(1,8): error TS1192: Module '"node_modules/vue/types/index"' has no default export.

It seems you changed import of vue in 4.0 which is causing the issue:
from: import * as Vue from 'vue';
to: import Vue from 'vue';

my package versions:
"vue": "~2.2.1",
"typescript": "~2.2.1"

my tsconfig:
"compilerOptions": {
"module": "amd",
"target": "es5",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitOnError": false,
"lib": [
"es2016",
"dom"
],
"moduleResolution": "node",
"skipLibCheck": true
}

@kaorun343
Copy link
Owner

https://vuejs.org/v2/guide/typescript.html

Please set allowSyntheticDefaultImports to true.

@agentschmitt
Copy link
Contributor Author

thx this solves the problem and since this is the recommend configuration from vue i will change my project to that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants