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

Error: No module factory available for dependency type: CssDependency

Posted at

Error: No module factory available for dependency type: CssDependency

windows環境で、Vue CLIを使用して作成したプロジェクトをBuildする時に、以下の様なエラーが出た。

PS C:\Users\---\git\hoge> yarn build
yarn run v1.19.1
$ vue-cli-service build

ERROR  Error: No module factory available for dependency type: CssDependency
Error: No module factory available for dependency type: CssDependency
    at addDependency (C:\Users\---\Git\hoge\node_modules\webpack\lib\Compilation.js:800:12)
    (以下略

原因

ディレクトリを移動した時に、ディレクトリ名にしていたGitをgitと打ち間違って、そのまま作業していたのが原因でした。
PowerShellではディレクトリ名の大文字小文字を間違えてもある程度柔軟に処理してくれるので、なかなか気づかなかったのですが、それが今回は仇になりモジュールがパスを見失っていたようでした。

) C:\Users\---\git\hoge
) C:\Users\---\Git\hoge

解決方法

正しいパスで入り直して実行したら特に問題無くビルド出来ました。

PS C:\Users\---\git\hoge> cd C:\Users\---\Git\hoge
yarn build

参考

Error: No module factory available for dependency type: CssDependency · Issue #5043 · vuejs/vue-cli

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