-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
client
and theme
are not exported
from exports
field in package.json
#913
Comments
Can you tell what error(s) were you getting? I don't think types need to be in |
// docs/.vitepress/theme/index.ts
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import * as components from '../components'
import './index.less'
const theme: Theme = {
...DefaultTheme,
enhanceApp({ app }) {
for (const [name, Component] of Object.entries(components))
app.component(name, Component)
},
}
export default theme We do have When using strict See https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing for more details. |
Although I'm not quite sure to understand why import DefaultTheme from 'vitepress/theme'
console.log('DefaultTheme:', DefaultTheme) It is documented at https://vitepress.vuejs.org/guide/theme-introduction.html#extending-the-default-theme |
client
and theme
is not exported
from exports
field in package.json
client
and theme
are not exported
from exports
field in package.json
OK, I found import DefaultTheme from "/@fs/Users/JounQin/Workspaces/Alauda/vision/node_modules/vitepress/dist/client/theme-default/index.js";
console.log("DefaultTheme:", DefaultTheme); So |
OK, finally, this is a TypeScript usage related issue. @brc-dd |
Yeah but your fix is still throwing this error in my case:
Without that fix, I was getting:
|
What command can I run to reproduce on this project? |
https://github.com/brc-dd/vp-issue Yeah I have those changes: |
OK, I'll check it ASAP. |
@brc-dd That's because there is no {
"private": true,
"type": "module"
} Then, the Both "Go to Definition" and "Go to Source Definition" will work as expected at the same time. |
@brc-dd See brc-dd/vp-issue#1 for demo. |
Besides, |
This is fixed on vite 3 branch. |
Glad to hear. Besides, do you think is there any chance how can I apply to be a member or collaborator or vite/vitepress groups? I'd like to spend more time working on vite/vitepress in the next few days. |
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: