Default export of the module has or is using private name ‘xx‘.ts(4082)

Project scenario:

vue+ts+setup 语法糖 declaration+interface+defineProps 报错


Problem Description

When declaring an interface, no matter what interface name is used, the above error will be reported

 



solution:

Tip: modify tsconfig.json, add "declaration": false,

{
  "compilerOptions": {
    "declaration": false,
    "forceConsistentCasingInFileNames": true,
    "baseUrl": ".",
    "strict": true,
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Node",
    "lib": ["ESNext", "dom"],
    "jsx": "preserve",
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true,
    "paths": {
      "@/*": ["src/*"]
    }
  },
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}

Guess you like

Origin blog.csdn.net/qq_38325751/article/details/130047746