Skip to content
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

[Bug report] personal theme set 'layouts/Layout.vue' to main field can not load index.styl #2178

Open
1 task done
yiliang114 opened this issue Feb 12, 2020 · 4 comments
Open
1 task done
Labels
type: bug Something isn't working

Comments

@yiliang114
Copy link

  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

you can see the package.json for my theme, if i just yarn start in local , maybe the package.json is not necessary. Thetheme/index.js in my theme is almost empty. And only do that as shown above, my theme can only to load index.styl automatically.

if i remove theme/index.js and set the "main" field to layouts/Layout.vue in package.json from the reference , after i run npm publish and install the latest theme, the style can not be load in the page.

What is expected?

set the "main" field to layouts/Layout.vue in package.json from the reference and publish my theme, people who installed the latest theme can load style correctly

What is actually happening?

theme may lose some style , due to the index.styl could not load automatically

Other relevant information

  • Output of npx vuepress info in my VuePress project:

Environment Info:

System:
OS: macOS Mojave 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 10.15.2 - /usr/local/bin/node
Yarn: 1.22.0 - ~/.yarn/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 80.0.3987.100
Firefox: 71.0
Safari: 13.0.4
npmPackages:
@vuepress/core: 1.3.0
@vuepress/theme-default: 1.3.0
vuepress: ^1.2.0 => 1.3.0
npmGlobalPackages:
vuepress: 1.2.0

@meteorlxy
Copy link
Member

Sorry but I cannot reproduce this issue. Please provide a "minimal" reproduce repo

@meteorlxy meteorlxy added needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos) status: awaiting more context Need more context about this issue labels Feb 12, 2020
@yiliang114
Copy link
Author

@meteorlxy I temporarily created a minimal reconstruction project link . You can just git clone it , then run npm install and npm start. when you open http://localhost:8080 , you can see a simple resume which like the following picture1.
picture1

But In fact, normal performance is like picture2.
picture2
image

After my screening the code, the only difference is the "main" field in package.json. I found only setting the "main" field "index.js" instead of "layouts/Layout.vue" (or other js file pathname) can make styles normally. But the official documentation said it could be "layouts/Layout.vue", I doubt that vuepress can not import styles/index.styl file automatically.

@meteorlxy meteorlxy added type: bug Something isn't working and removed needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos) status: awaiting more context Need more context about this issue labels Feb 17, 2020
@meteorlxy
Copy link
Member

meteorlxy commented Feb 17, 2020

Confirmed. That's an issue about resolving theme path.

Well, I personally decline 'layouts/Layout.vue' way, as it's mainly for compatibility with 0.x themes. That might be dropped in the future

@meteorlxy
Copy link
Member

Figured out the reason. This issue was caused by #1564, which did not fix the corresponding issue correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants