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

No theme.d.ts file in the installed library #438

Closed
3 tasks done
roamiiing opened this issue Nov 7, 2021 · 1 comment
Closed
3 tasks done

No theme.d.ts file in the installed library #438

roamiiing opened this issue Nov 7, 2021 · 1 comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@roamiiing
Copy link

Describe the bug

I want to use TS for my theme config, but I get the following error:

TS2307: Cannot find module 'vitepress/theme' or its corresponding type declarations.

I think it happens because there is no theme.d.ts in the files array of package.json.

Reproduction

  1. Install vitepress
  2. Create docs/.vitepress/theme/index.ts file
  3. Type import DefaultTheme from 'vitepress/theme'
  4. Get the error from the IDE

Expected behavior

No type error

System Info

System:
    OS: macOS 11.3.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 25.62 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.4.1 - ~/.nvm/versions/node/v16.4.1/bin/node
    npm: 7.18.1 - ~/.nvm/versions/node/v16.4.1/bin/npm
  Browsers:
    Chrome: 95.0.4638.69
    Firefox Developer Edition: 92.0
    Safari: 14.1
  npmPackages:
    vitepress: ^0.20.1 => 0.20.1

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@roamiiing roamiiing added the bug: pending triage Maybe a bug, waiting for confirmation label Nov 7, 2021
@yyx990803
Copy link
Member

#489 (comment)

yyx990803 added a commit that referenced this issue Jan 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants