1
1

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 5 years have passed since last update.

Vue-Cli UI上でビルドするとError:CssDependencyが出る

Posted at

はじめに

最近、フロントエンドのお勉強を始めました。
Vue?なにそれ?から二日目です。

Qiitaの投稿もmarkdown記法も初めてなので簡潔に。

ネットで拾ったチュートリアルを終えて、 build してみるかってとこで表題のエラー。

環境

vue-cli 4.2.3

エラー内容

Vue UI上でbuild実行時の出力

$ vue-cli-service build --mode production --dest dist --target app --dashboard

- Building for production...

ERROR Error: No module factory available for dependency type: CssDependency
Error: No module factory available for dependency type: CssDependency
...
...

コンソール上でのnpm run buildは正常終了するのに、UI上でビルドするとエラーになる。何故だ。

原因

実際のパスとVue UIが認識しているパスが異なってるのが原因っぽい。
参考:Error: No module factory available for dependency type: CssDependency #5154

問題があったのは下プロジェクト。
C:\Users\...\Vue_CrashCourse\vue_realtime_chatが正しいパス。
Vue UI上でプロジェクト作成したあと、直接フォルダ名を変えたのが悪かった。

コメント 2020-03-20 160113.png

解決法

インポートし直す。

serveは動くから「なんでなんで」だったけど、シンプルなミスでした。
ネット情報だとwebpackだったり、vueRouterのmodeが原因になりえるみたい。

以上。
Vueおもしろいっすね。

1
1
1

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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?