When I `init` then `build` a brand-new project, without making any changes, it fails to build css
gbirchmeier opened this issue · comments
Expected behavior and actual behavior
Expected behavior:
Init'ing a new project and building the freshly-init'd project should work without error:
> gem install middleman
# (installs middleman-4.4.3.gem, middleman-cli-4.4.3.gem, middleman-core-4.4.3.gem)
> middleman init foo
# (also installs middleman-autoprefixer-2.10.1)
> cd foo
> bundle exec middleman build
I expect that last command complete without errors.
Actual behavior:
The build
command fails to build the css file:
2004 ~/tmp/mmtest/foo$ bundle exec middleman build
DEPRECATION WARNING: autoprefixer-rails was deprected. Migration guide:
https://github.com/ai/autoprefixer-rails/wiki/Deprecated (called from eval at /Users/grantb/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22)
TypeError: Cannot read properties of undefined (reading 'version')
error build/stylesheets/site.css
create build/images/.keep
create build/javascripts/site.js
create build/index.html
There were errors during this build, re-run with `middleman build --verbose` to see the full exception.
Full output with --verbose
is here: verbose_output.log
Steps to reproduce the problem (from a clean middleman installation)
As detailed above.
Additional information
- Ruby version: 3.2
- Middleman version: 4.4.3
- OS version: OS X 12.5.1 "Monterey"
Further investigation
If I delete source/stylesheets/site.css.scss
completely, then I get no error (and obviously no generated css file), so clearly the problem is with the css generation.
In fact, the error occurs for any and every css, sass, or scss file. It doesn't matter if the file is empty or has valid or invalid content-- it always fails the same for each file.
For instance, this tree structure:
2065 ~/tmp/mmtest/foo$ tree source/
source/
├── images
├── index.html.erb
├── javascripts
│ └── site.js
├── layouts
│ └── layout.erb
└── stylesheets
├── blah.css
├── doop.sass
├── poo.pants
└── site.css.scss
results in:
2042 ~/tmp/mmtest/foo$ bundle exec middleman build
DEPRECATION WARNING: autoprefixer-rails was deprected. Migration guide:
https://github.com/ai/autoprefixer-rails/wiki/Deprecated (called from eval at /Users/grantb/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22)
DEPRECATION WARNING: autoprefixer-rails was deprected. Migration guide:
https://github.com/ai/autoprefixer-rails/wiki/Deprecated (called from eval at /Users/grantb/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22)
TypeError: Cannot read properties of undefined (reading 'version')
TypeError: Cannot read properties of undefined (reading 'version')
error build/stylesheets/site.css
error build/stylesheets/blah.css
identical build/images/.keep
identical build/javascripts/site.js
create build/stylesheets/poo.pants
error build/stylesheets/doop
identical build/index.html
There were errors during this build, re-run with `middleman build --verbose` to see the full exception.
Oddly, the non-style file is copied correctly.
Ugh, why does the current gem release have issues that were identified and solved more than a year ago?
#2480
#2463
plus middleman/middleman-templates-default#13
and https://forum.middlemanapp.com/t/resolved-default-template-css-rendering-failed/4615