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

Dependency not found error can be misleading #73

Closed
renestalder opened this issue Dec 14, 2018 · 3 comments
Closed

Dependency not found error can be misleading #73

renestalder opened this issue Dec 14, 2018 · 3 comments

Comments

@renestalder
Copy link

Description

If you're referencing own, internal dependencies (not node_modules) that do not exist, Gridsome answers with:

This dependency was not found:

* ~/layouts/Default.vue in ./src/main.js

To install it, you can run: npm install --save ~/layouts/Default.vue

I'm not sure if this comes from Webpack or Gridsome. But I work quite some years with Webpack and never got the suggestion to install something via npm the way Gridsome does.

Steps to reproduce

Import a file or asset that doesn't exist.

Expected result

Error about missing dependency, but no note about installing dependencies when using Webpack's tilde to reference.

Actual result

Tells me to install dependencies via npm which would not work of course.

@hjvedvik
Copy link
Member

hjvedvik commented Apr 1, 2019

The message comes from friendly-errors-webpack-plugin and it looks like it only checks for ./and ../ to determine if it's a module or package, so an alias like ~ is treated as a package. I'm not sure what we can do about it.

@robaxelsen
Copy link
Member

Closing this, as issue is caused by webpack plugin and not Gridsome.

@jimfilippou
Copy link

Any work around? Closing issues without referencing anything is not smart..

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

No branches or pull requests

4 participants