vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.51k stars 4.76k forks source link

Plugin Debug Help wanted #1942

Closed Mister-Hope closed 4 years ago

Mister-Hope commented 4 years ago

After update to version 1.2.0, I removed smooth-scroll from my own theme, and add smoothScroll: true in my themeConfig, and I saw an error.

wait Extracting site metadata...
tip Apply theme vuepress-theme-hope (extends @vuepress/theme-default) ...
warning An error was encounted in plugin "smooth-scroll"
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin copyright (i.e. "vuepress-plugin-copyright") ...
tip Apply plugin flowchart (i.e. "vuepress-plugin-flowchart") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
tip Apply plugin @vuepress/pwa (i.e. "@vuepress/plugin-pwa") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/medium-zoom (i.e. "@vuepress/plugin-medium-zoom") ...
tip Apply plugin mathjax (i.e. "vuepress-plugin-mathjax") ...
tip Apply plugin named-chunks (i.e. "vuepress-plugin-named-chunks") ...

while the smoth scroll featrue doesn't work.

This error will disappear after I rolled back to V1.1.0, and enable it by my own.

I am curious about it. I think the reason is that I have build or wrote something conflict with it.


Now I am very confused, because this error seems to be trigged at @vuepress/core and I am not familar with it. And I also don't have any infomation about with file or which line caused this error.

In a word, I don't know where to start debuging my code..... :cry:

If anyone can provide me some helps or opinions how can I debug this error, I will be very grateful.


kefranabg commented 4 years ago

I'll close this issue as it's not a bug related to VuePress.

From what you're saying, your issue is related to your own development. Please open an issue to your own repository instead of VuePress.

If you can't figure out what's wrong with your repos. Feel free to reopen an issue if you're sure that the problem is related to VuePress

Mister-Hope commented 4 years ago

I'll close this issue as it's not a bug related to VuePress.

From what you're saying, your issue is related to your own development. Please open an issue to your own repository instead of VuePress.

If you can't figure out what's wrong with your repos. Feel free to reopen an issue if you're sure that the problem is related to VuePress

I think it is , at least there are conflicts, whatever I wrote, it's the smoth-scroll plugin falls with an error hint and no more details. I just want to ask how to debug to find out with line in the smoth-scroll plugin triggeres this error

kefranabg commented 4 years ago

Are you talking about this plugin? If it's the case, just remove it from your plugin list and just use smoothScroll from VuePress config.

Mister-Hope commented 4 years ago

VuePress default theme is using this plugin to provide smooth scroll bro. :cry: It seems that you are not familar with this part

I spent a couple of hours, I create serveral repos, and I found something.

Mister-Hope commented 4 years ago

It seems sometime npm will generate a different tree, and put plugin-smooth-scroll under theme-default folder. That 100% cause the error I mentioned.

But the strange thing is when I run npm list , plugin-smooth-scroll is only under theme-default, with no other version in the project.

When I dragged this folder out, the error disappeared.

This even happens when I removed my theme out of the package.json, so alt least there are some problems with the package or other packages. (Cause it happens without my theme and no configuration in .vuepress/config.js)

I am working to find out the reason. I will leave a new comment if I figure out anything later.

P.S: Suggest you open this issue.

Mister-Hope commented 4 years ago

image image

I really messed up, I use the same package.json and run npm install in two folders, and I got a different result. The left one will cause the error I mentioned while the right one didn't

Mister-Hope commented 4 years ago

Would you mind I open a new issue about this?

kefranabg commented 4 years ago

Whoops, indeed it's using this plugin, I missed that 😉 Could you open a new clean issue following the issue template with the informations from your latest comments ? Thank you.

Mister-Hope commented 4 years ago

No problem. 😃 I just want someone give me a hand with it.

kefranabg commented 4 years ago

Also it would be great if you could provide a reproduction repos link

Mister-Hope commented 4 years ago

Sure, I am trying to make one