Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The name "Ref" could not be found. ts(2304) #259

Closed
5 tasks done
eachann1024 opened this issue Aug 28, 2022 · 1 comment
Closed
5 tasks done

The name "Ref" could not be found. ts(2304) #259

eachann1024 opened this issue Aug 28, 2022 · 1 comment

Comments

@eachann1024
Copy link

eachann1024 commented Aug 28, 2022

Describe the bug

If dts: true is configured, it should support ts derivation, right? Is it my problem?

Checked:#90

I found that the method I introduced should be correct

img

const count = ref(0) // not error

function changeCount(x: Ref<number>) {   // error occurred
	x.value++
}
// viteconfig.ts
AutoImport({
      imports: [
        'vue',
        'vue/macros',
        'vue-router',
        '@vueuse/core',
      ],
      dts: true,
      dirs: [
        './src/composables',
      ],
      vueTemplate: true,
    })
{
  "compilerOptions": {
    "baseUrl": ".",
    "module": "ESNext",
    "target": "es2016",
    "lib": [
      "DOM",
      "ESNext"
    ],
    "strict": true,
    "jsx": "preserve",
    "esModuleInterop": true,
    "skipLibCheck": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "noUnusedLocals": true,
    "strictNullChecks": true,
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "types": [
      "vite/client",
      "vite-plugin-pages/client",
    ],
    "paths": {
      "~/*": [
        "src/*"
      ]
    }
  },
  "include": [
    "**/*.d.ts",
  ],
  "exclude": [
    "dist",
    "node_modules"
  ]
}

Reproduction

1

System Info

vsc + mac13

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Member

antfu commented Aug 28, 2022

#61

@antfu antfu closed this as completed Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants