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

Build error with plugin #1414

Closed
1 task done
gluons opened this issue Mar 7, 2019 · 6 comments
Closed
1 task done

Build error with plugin #1414

gluons opened this issue Mar 7, 2019 · 6 comments
Labels
has workaround Has a workaround type: bug Something isn't working

Comments

@gluons
Copy link

gluons commented Mar 7, 2019

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

Bug report

Some of user report error from my component plugin for VuePress.
I can't find solution to fix it. Maybe bug?

Version

v1.0.0-alpha.42

Steps to reproduce

Example repo: https://github.com/gluons/vuepress-issue-1414

What is expected?

Build complete without errors.

What is actually happening?

Get error from vuepress build but vuepress dev works perfectly.

screenshot-vuepress-build

Other relevant information

  • Your OS: Windows 10
  • Node.js version: v10.15.1
  • Browser version: -
  • Is this a global or local install? Local
  • Which package manager did you use for the install? Yarn 1.13.0
  • Does this issue occur when all plugins are disabled? No
@ulivz ulivz added the type: bug Something isn't working label Mar 7, 2019
@YunYouJun
Copy link
Contributor

Hello, I run the case.

yarn dev

But I get Uncaught Error: Cannot find module 'vue-component-with-plugin' in console.

This plugin has been applied.
image

I guess something error in vue-component-with-plugin/plugins/vuepress/index.js#L6.

Maybe it doesn't know where to import from?

@gluons
Copy link
Author

gluons commented Mar 8, 2019

@YunYouJun Did you follow Steps to repro in my repo?

cd vue-component-with-plugin
yarn
yarn build
cd ..
cd vuepress-project
yarn
yarn dev

It works without any error on my side.

default

@YunYouJun
Copy link
Contributor

YunYouJun commented Mar 8, 2019

I deleted it , then reproduced it. And it works. 😢
I am sorry for my carelessness and helplessness.

@shigma
Copy link
Collaborator

shigma commented Mar 8, 2019

After many attempts, I found that using require('../../vue-component-with-plugin/plugins/vuepress') instead of require('vue-component-with-plugin/plugins/vuepress') may solve the problem.

However I still don't know what caused the issue.

@shigma
Copy link
Collaborator

shigma commented Mar 13, 2019

Similar to #451. I believe it is a duplicate issue.

@shigma shigma added duplicate has workaround Has a workaround labels Mar 13, 2019
@shigma
Copy link
Collaborator

shigma commented Mar 13, 2019

@gluons You can use relative path to workaround this issue. Let's move to #451 to continue discussion.

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

No branches or pull requests

4 participants