vuepress / vuepress-community

:bulb: Community supported ecosystem for VuePress
https://vuepress-community.netlify.app
MIT License
81 stars 62 forks source link

[Bug Report] vupress-types: themeConfig is not optional in siteData #15

Closed Mister-Hope closed 4 years ago

Mister-Hope commented 4 years ago

I am meeting error with themeConfig in SiteData here

If there isn't any config, vuepress will generate a {} for themeConfig here.

Now the expression like this.$site.themeConfig.nav in the default theme catches error because ts will think themeConfig can be undefined. If effects almost all the vue files in theme-default package .

For detail, you can simply add a folder with only a README.md file in it add let vuepress server it.

Mister-Hope commented 4 years ago

image

meteorlxy commented 4 years ago

Confirm that there are some problems with this.$site.themeConfig.

But this.$themeConfig should work.

meteorlxy commented 4 years ago

Fixed in vuepress-types@0.8.0

Mister-Hope commented 4 years ago

image image

Excuse me, still catching errors in my project which I am tring to rewrite the theme-default package with ts.

meteorlxy commented 4 years ago

upgrade to the latest version, plz

Mister-Hope commented 4 years ago

My VSCode problem, on my Linux it's working fine.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.