Gridsome: Dependency not found error can be misleading

Created on 14 Dec 2018  路  3Comments  路  Source: gridsome/gridsome

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.

Most helpful comment

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

All 3 comments

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.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattbrailsford picture mattbrailsford  路  3Comments

igregson picture igregson  路  3Comments

tomtev picture tomtev  路  3Comments

kaceo picture kaceo  路  3Comments

tomtev picture tomtev  路  3Comments