Renovamen / vuepress-theme-gungnir

A blog theme for VuePress 2.
https://v2-vuepress-theme-gungnir.vercel.app
Apache License 2.0
362 stars 79 forks source link

[Bug report] usePageFrontmatter() is called without provider. #55

Closed ciocoa closed 2 years ago

ciocoa commented 2 years ago

✅ Checklist

🔎 Description

大佬你好,很喜欢你的主题,本人小白一个,最近在自己做一些尝试,搭建静态博客

build时出错,页面无法显示


在启动开发服务器时(npm run dev)一切都是正常的,博客能正常运行,基本功能都能使用,并且控制台没有输出任何错误。

然而当我试着构建时(npm run build)在 Rendering pages 时报错Error: usePageFrontmatter() is called without provider. 我不清楚问题的具体来源,一直找不到原因,希望大佬能帮忙看看,感激不尽

这是在vercel上部署时的错误:

image

📄 Environment info (npx vuepress info)

System:
    OS: macOS 12.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 3.13 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 17.8.0 - ~/.nvm/versions/node/v17.8.0/bin/node
    Yarn: Not Found
    npm: 8.6.0 - ~/.nvm/versions/node/v17.8.0/bin/npm
  Utilities:
    Git: 2.32.0 - /usr/bin/git
  Browsers:
    Chrome: 100.0.4896.88
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.5
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.39 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.38 
    @vuepress/client:  2.0.0-beta.35 (2.0.0-beta.38)
    @vuepress/core:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/markdown:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-active-header-links:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-back-to-top:  2.0.0-beta.38 
    @vuepress/plugin-container:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-beta.38 
    @vuepress/plugin-git:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-google-analytics:  2.0.0-beta.36 
    @vuepress/plugin-medium-zoom:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-nprogress:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-palette:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-prismjs:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-pwa:  2.0.0-beta.36 
    @vuepress/plugin-pwa-popup:  2.0.0-beta.36 
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: Not Found
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.36 (2.0.0-beta.38)
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.35 (2.0.0-beta.38)
    @vuepress/theme-default:  2.0.0-beta.38 
    @vuepress/utils:  2.0.0-beta.35 (2.0.0-beta.38)
    vue:  3.2.32 
    vue-loader: Not Found
    vue-router:  4.0.14 
    vuepress: ^2.0.0-beta.39 => 2.0.0-beta.39 
    vuepress-vite:  2.0.0-beta.39 
    vuepress-webpack: Not Found

🔗 Reproduction link / repo:

No response

shaul-xu commented 2 years ago

I also had the same problem.

alomerry commented 2 years ago

I also had the same problem.

Me too.

Zhengqbbb commented 2 years ago

At present, the problem is that it is not compatible with the latest version: Please lock the version number: v2.0.0-beta.36

Zhengqbbb commented 2 years ago

My package.json:

image

ciocoa commented 2 years ago

Thanks, the locked version does work, it builds successfully. But an error is reported when starting the dev server: Uncaught (in promise) Error: useThemeLocaleData() is called without provider.

Zhengqbbb commented 2 years ago

Thanks, the locked version does work, it builds successfully. But an error is reported when starting the dev server: Uncaught (in promise) Error: useThemeLocaleData() is called without provider.

Zhengqbbb commented 2 years ago

v2.0.0-alpha.20 Tested and worked successfully ! ~ 🤩 @Renovamen 👏

Renovamen commented 2 years ago

@Zhengqbbb Nice, thanks!

@Alomerry @ciocola @shaul-xu The latest version (v2.0.0-alpha.20) should be compatible with VuePress v2.0.0-beta.39, please have a try. Let me know if there are still any issues. Thanks for reporting it!

ciocoa commented 2 years ago

Thanks a lot, everything works fine for dev and build.