LoginSignup
4
0

More than 5 years have passed since last update.

Webpacker バージョンアップ後、アセットプリコンパイルで Cannot find module 'postcss-smart-import' エラー

Last updated at Posted at 2018-03-25

Webpacker のバージョンをあげたところ、下記のエラーが発生したので、解決方法をメモ。

Module build failed: Error: Loading PostCSS Plugin failed: Cannot find module 'postcss-smart-import'

バージョン情報

  • Ruby : 2.4.2
  • Rails : 5.1.4
  • React : 16.2.0
  • Redux : 3.7.2
  • Webpacker : 3.3.1

webpacker/css.md at master · rails/webpacker を見ると、 .postcssrc.yml は以下のようになっている。

.postcssrc.yml
plugins:
  postcss-import: {}
  postcss-cssnext: {}

postcss-smart-import ではなく postcss-import を使うようになった?
以下のように修正すると、エラーが解消した。

.postcssrc.yml(差分)
 plugins:
-  postcss-smart-import: {}
+  postcss-import: {}
   postcss-cssnext: {}
4
0
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
4
0