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

type issues #20

Closed
markmartirosian opened this issue Aug 26, 2022 · 5 comments
Closed

type issues #20

markmartirosian opened this issue Aug 26, 2022 · 5 comments

Comments

@markmartirosian
Copy link

src/create-app.ts:2:34 - error TS2307: Cannot find module '@vueuse/schema-org-vite/vite' or its corresponding type declarations.

2 import { installSchemaOrg } from '@vueuse/schema-org-vite/vite'
import {
  useSchemaOrg,
  defineWebSite,
  defineOrganization
} from '@vueuse/schema-org/runtime'

Cannot find module '@vueuse/schema-org/runtime' or its corresponding type declarations.
@harlan-zw
Copy link
Collaborator

harlan-zw commented Aug 29, 2022

Hey @markmartirosian

Not sure too why you would be getting the first error. The types are linked up correctly as far as I can tell, but I'll investigate this further soon.

As for the second issue, make sure you have dts: true in the Vite plugin, as it will write in your tsconfig the resolves path to this alias.

SchemaOrg({
      // ...
      // write type alias to tsconfig.json
      dts: true,
}),

Are you using any specific Vite framework that I can try and make a replication with?

@markmartirosian
Copy link
Author

@harlan-zw thank you! It's a generic vite, vue, ts, pnpm setup. I tired dts: true with the same effect. My suspicion is that it's related to pnpm, but I'm not sure.

A side question, is it possible to avoid aliases?

@harlan-zw
Copy link
Collaborator

By default, the package.json alias @vueuse/schema-org/runtime should point to simple types.

    "./runtime": {
      "types": "./dist/runtime-simple/index.d.ts",
      "import": "./dist/runtime-simple/index.mjs"
    },

The dts: true should only be needed if you're switching to the full types (full: true), though sometimes it helps avoid type issues.

The alias is used for the 0kb runtime, you could try import directly from @vueuse/schema-org/runtime-simple or @vueuse/schema-org/dist/runtime-simple

@harlan-zw
Copy link
Collaborator

I've implemented typeVersions in 1.1.0-beta.1 which may fix the issue, could you test with this version and let me know if you have any success

@harlan-zw
Copy link
Collaborator

This should be resolved with v2. Let me know if you have any issues

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