-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Theme error building a site and sometimes even showing VuePress site #575
Comments
The same display error, showing VuePress site https://vuepress.vuejs.org, was reported in #583, using Mac. |
The three black rectangles comes from the tag in "sidebar-button" div. |
I am having the precisely same issue here on a Windows machine, where
I also get the following warning message each time I try building: I tried to delete all the service workers from other sites as suggested in #583 but the problem remains unresolved. |
I might have found a "solution" to this issue. While watching Evan You's VueNYC talk/demo video on Youtube, I noticed that he actually does not try to open the generated html files. Instead, he served the site via I've tried this method myself, and the Vuepress site is rendered as expected! It doesn't really take more than installing anywhere, which takes only a second, so you might want to give it a try. |
Great, @bobaekang, it worked for me! |
This's question that's not very easy to explain. and this is not an issue from VuePress, but from html-webpack-plugin. First, VuePress is based on webpack, In VuePress, the default publicPath(i.e base in VuePress) is <script type="text/javascript" src="/assets/js/app.9687e57b.js"></script> instead of: <script type="text/javascript" src="assets/js/app.9687e57b.js"></script> So you cannot open it in local directly. publicPath
So if you deploy your site to a non-root URL, it's a very useful feature - your source code will only need to maintain the relative path. Preview a root-URL site at local.To preview it in local, you need a a static server.
Preview non-root-URL site at local.Since the most of the local static servers does not provide the mount function, we cannot serve it directly. but If you are familiar with how static servers work, you'll know there is a simple hack. e.g. you base is set to '/sub/', you need:
ConclusionLet's use a static server instead of opening the files directly, that is simple and consistent with the behavior of the production environment. References |
Just curious, if we have to serve the contents of For example, I copied the content of and it doesn't have proper styling. EDIT: After adding |
Maybe you write the base and you don't need it. |
Bug report
Version
0.10.1
Steps to reproduce
I followed the instructions at https://vuepress.vuejs.org/guide/getting-started.html#global-installation:
I also installed using npm and the same error happened.
What is expected?
A VuePress page with theme.
What is actually happening?
The (tiny) content was shown in a buggy theme,
with three black rectangles first and then the content without formatting,
as show at:
VuePress.pdf
Other relevant information
In a certain moment, even the VuePress site loaded with the same error in my Ubuntu Desktop
(it did not happened in my Android cell phone).
I tried in two Ubuntu desktops, with 16.04 and 18.04.
If it is not a bug, but a installation error, at least the instructions could be cleaner, avoiding this error.
The text was updated successfully, but these errors were encountered: