UPDATE: Initially, I believed that the issue was caused by the custom theme; however, I have since revised the question. The live demo has also been fixed.
I have developed a customized theme for VuePress by extending the @vuepress/theme-default
with some new Vue components. Everything runs smoothly when using vuepress dev
. However, after creating a site with vuepress build
, none of the event listeners are attached, resulting in issues such as the menu not opening when the button is clicked.
You can access the source code on GitHub.
Additionally, a live demonstration is available there: You can inspect the menu button (located at
#app > div.theme-container.sections-layout > header > div.sidebar-button
) and compare it to the one at .
The issue appears to stem from the mounted
hooks not being executed in the version generated by build
. According to the documentation, browser API access should occur within the beforeMount
or mounted
hooks. It seems like this is where the problem lies.
Any insights or suggestions on how to resolve this?
I am utilizing VuePress cli.js/1.2.0 win32-x64 node-v12.13.0