Webpacker: Module not found: Error

Created on 30 Apr 2019  路  2Comments  路  Source: rails/webpacker

ERROR in ./app/javascript/packs/application.js
Module not found: Error: Can't resolve '@rails/ujs' in 'path_to_project/app/javascript/packs'
@ ./app/javascript/packs/application.js 5:0-21

ERROR in ./app/javascript/packs/application.js
Module not found: Error: Can't resolve '@rails/activestorage' in 'path_to_project/app/javascript/packs'
@ ./app/javascript/packs/application.js 9:0-31

@rails/activestorage and @rails/ujs exist in node_modules

Most helpful comment

remove 'assets' from .yarnclean solves this problem.

All 2 comments

remove 'assets' from .yarnclean solves this problem.

@chenkovsky, I spent hours trying to track down this problem. Thank you!

Was this page helpful?
0 / 5 - 0 ratings