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

feat: enhance error message when plugin module isn't loaded correctly #4194

Closed
wants to merge 1 commit into from
Closed

Conversation

pburdette
Copy link
Contributor

Fix for #4024

@sodatea Let me know if it makes more sense to implement this change somewhere else in the codebase.

@haoqunjiang
Copy link
Member

Thanks for this PR! But the error actually comes from here:

invoke.runGenerator(context, {
id: 'core:router',
apply: loadModule('@vue/cli-service/generator/router', context),
options
})

For normal plugins, we do have proper error handling:

const id = findPlugin(pkg.devDependencies) || findPlugin(pkg.dependencies)
if (!id) {
throw new Error(
`Cannot resolve plugin ${chalk.yellow(pluginName)} from package.json. ` +
`Did you forget to install it?`
)
}
const pluginGenerator = loadModule(`${id}/generator`, context)
if (!pluginGenerator) {
throw new Error(`Plugin ${id} does not have a generator.`)
}

So once this issue is resolved and vuex & vue-router become standalone plugins, the error message will be correctly displayed. I think @pksunkara is currently working on this.

@pksunkara
Copy link
Contributor

I just implemented the first part of it, PR #4196

@pburdette
Copy link
Contributor Author

@sodatea ahh makes sense now. This sounds like a more permanent fix. Is there a way I can get in touch to find out what issues to work on? I plan on dedicating some time to knock out some smaller issues. Thanks

@haoqunjiang
Copy link
Member

@beardedpayton @pksunkara

Just wrote up a Status of Vue CLI
Thanks for all your kind help 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants