14
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Unable to resolve path to module

Last updated at Posted at 2019-08-03

症状

"Unable to resolve path to module"というeslintエラーが発生する。

原因

importする際、パスは絶対パスを使ってくれということだが、buildする時には特に問題にならない。

対応

  • eslint-import-resolver-webpackをインストール

    npm install --save-dev eslint-import-resolver-webpack
    
  • .eslintrc.jsonに下記の設定を追加

    {
    "settings": {
        "import/resolver": "webpack"
      }
    }
    

別にこれはeslintのチェックからoffした方がもっとシンプルで良さそうな気がする。

  • .eslintrc.jsonのrulesに下記の設定を追加

    "import/no-unresolved": "off"
    

参考

14
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?