Default export of the module has or is using private name 'Props'
See original GitHub issuewhen upgrade volar to ^0.34.9 , there is a ts warning Default export of the module has or is using private name 'Props'
at the top of template
//error info -> Default export of the module has or is using private name 'Props'. ts(4082)
<template>test</template>
<script lang="ts" setup>
//step1: declear type
interface Props {
foo: string;
}
// setp2: defineProps
defineProps<Props>();
</script>
but if definePorps like below, the warning disappear
<template>test</template>
<script lang="ts" setup>
defineProps<{
foo: string;
}>();
</script>
Issue Analytics
- State:
- Created a year ago
- Comments:22 (6 by maintainers)
Top Results From Across the Web
Typing error "Default export of the module has or is using ...
error TS4082 : Default export of the module has or is using private name 'Reducer'. Any idea on what's going on and how...
Read more >Typescript - Default export of the module has or is using ...
I've been trying for a day to resolve without success. I had a project that worked, now it doesn't.
Read more >Default export of the module has or is using ... - Vue Forum
I just migrate my TypeScript project to Vue 2.5. I try to export my install function of my plugin import Vue from 'vue';...
Read more >TSConfig Option: allowSyntheticDefaultImports - TypeScript
This option brings the behavior of TypeScript in-line with Babel, where extra code is emitted to make using a default export of a...
Read more >TypeScript: has or is using private name - CodeSandbox
thejohnfreemanJohn Freeman. Forked Fromobserver + nested props; Environmentcreate-react-app-typescript. Files. Model.ts. index.html. index.ts. package.json.
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 Free
Top 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
Hi,
I found a lighter alternative to moving the interfaces: exporting them also works with Volar 0.38.1.
But I totally agree with @buckeyez. Volar should comply with Vue, and not the other way around.
Hi @hayabusa2009, try remove
"declaration": true
in tsconfig or move interface Props to script block.