mhanberg / mhanberg/jekyll-postcss

Running "bundle exec jekyll serve" freezes on "Requiring: jekyll-postcss"

Open
#37 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
70
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Platform: Windows

I'm trying to get TailwindCSS working with my new Jekyll project, and when I run `bundle exec jekyll serve --verbose` it freezes. Force-quitting the process with ctrl+c displays the following:

```
$ bundle exec jekyll serve --verbose
Logging at level: debug
Jekyll Version: 4.2.2
Configuration file: xxxxxxxxx/_config.yml
Logging at level: debug
Jekyll Version: 4.2.2
Requiring: jekyll-feed
Requiring: jekyll-postcss
------------------------------------------------
Jekyll 4.2.2 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
Traceback (most recent call last):
29: from C:/Ruby27-x64/bin/jekyll:23:in `'
28: from C:/Ruby27-x64/bin/jekyll:23:in `load'
27: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/exe/jekyll:15:in `'
26: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
25: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
24: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
23: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
22: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
21: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
20: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
19: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `each'
18: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
17: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/commands/build.rb:30:in `process'
16: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/commands/build.rb:30:in `new'
15: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:36:in `initialize'
14: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:133:in `setup'
13: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:319:in `instantiate_subclasses'
12: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:319:in `tap'
11: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:321:in `block in instantiate_subclasses'
10: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:321:in `map!'
9: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:321:in `block (2 levels) in instantiate_subclasses'
8: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:321:in `new'
7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `initialize'
6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `fetch'
5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `block in initialize'
4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `new'
3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:13:in `initialize'
2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:62:in `start_dev_server'
1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:62:in `open'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:62:in `initialize': Interrupt
```

Here are all of my current config files, with what I believe are irrelevant lines stripped out:

**_config.yml**:
```yaml
# Build settings
plugins:
- jekyll-feed
- jekyll-postcss

# example from https://github.com/stefcoetzee/jekyll-tailwind/blob/main/_config.yml
sass:
sourcemap: never

# disable caching for Tailwind JIT
postcss:
cache: false

# files Jekyll should not delete from .site
keep_files:
- css/tailwind.css
- css/tailwind.css.map
```

**postcss.config.js**
```js
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
...(process.env.JEKYLL_ENV == "production"
? [require('cssnano')({ preset: 'default' })]
: [])
]
};
```

**tailwind.config.js**
```js
module.exports = {
content: [
'./_includes/**/*.html',
'./_layouts/**/*.html',
'./_posts/*.md',
'./*.html',
],
theme: {
extend: {}
},
variants: {},
plugins: [
require('@tailwindcss/typography'),
],
}
```

I'm happy to include any other details that you might need.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lib/jekyll-postcss/socket.rb, especially start_dev_server, and reproduce the Windows command `bundle exec jekyll serve --verbose` using the reported _config.yml and PostCSS configuration. Trace why startup remains blocked at the socket initialization; done means Jekyll serves successfully without freezing while retaining the reported Tailwind CSS setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, ruby, tailwindcss
Domain
build-system, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.