Strange behavior after deleting phoenix.css

I’ve been using Tailwind for an app with no problems, so today I deleted the stock phoenix.css file and removed @import "./phoenix.css"; from my app.scss

However, my app is now giving some strange output when running with mix phx.server:

[hardsource:4f50d92e] Using 19 MB of disk space.

This is almost twice as much space as my app used before deleting phoenix.css. I was hoping to reduce the space needed!

[hardsource:4f50d92e] Tracking node dependencies with: package-lock.json.
[hardsource:4f50d92e] Reading from cache 4f50d92e...
[hardsource:4f50d92e] Could not freeze ../deps/phoenix/priv/static/phoenix.js: Cannot read property 'hash' of undefined
[hardsource:4f50d92e] Could not freeze ../deps/phoenix_html/priv/static/phoenix_html.js: Cannot read property 'hash' of undefined
[hardsource:4f50d92e] Could not freeze ../deps/phoenix_live_view/priv/static/phoenix_live_view.js: Cannot read property 'hash' of undefined
[hardsource:4f50d92e] Could not freeze ./js/app.js: Cannot read property 'hash' of undefined
[hardsource:4f50d92e] Could not freeze ./js/hooks.js: Cannot read property 'hash' of undefined
[hardsource:4f50d92e] Could not freeze ./js/line-chart.js: Cannot read property 'hash' of undefined
[hardsource:4f50d92e] Could not freeze ./node_modules/nprogress/nprogress.js: Cannot read property 'hash' of undefined
[debug] Live reload: priv/static/js/app.js
[debug] Live reload: priv/static/js/app.js
[debug] Live reload: priv/static/css/app.css
[debug] Live reload: priv/static/images/phoenix.png
[debug] Live reload: priv/static/js/app.js
[debug] Live reload: priv/static/images/phoenix.png
[debug] Live reload: priv/static/images/phoenix.png
[debug] Live reload: priv/static/css/app.css
[debug] Live reload: priv/static/css/app.css

This is all totally new. The launcher seems to hang for a few seconds right before this output.

I expected some styling changes, but not such drastic effects from deleting this file which said right at the top that it was OK to delete it. I’ve been troubleshooting the issue for a while today with no luck besides just adding the file and import back. Does anyone have a hunch as to what’s going on with this?

Deleting node_modules/.cache should fix it :+1:.

This happens from time to time with me too, it’s not related to the phoenix.css file though. I suppose it could be related to webpack watching the files but I don’t know.

Also, this has been a constant headache of mine because this prevents code changes to be served on the page and it’s not always quickly noticed, being easily mistaken by cache or a simple mistake :laughing:.

3 Likes

Thanks! It did reduce the space as well as remove the errors. I’ll keep this in mind moving forward!

It seems to be this issue: TypeError: Cannot read property 'hash' of undefined · Issue #416 · mzgoddard/hard-source-webpack-plugin · GitHub

It has a PR since 2018, but not yet merged.

1 Like