I am using Jekyll with JSON data files to generate a website that consists of roughly 250 pages for each language (~8 languages).
The JSON file I am using to pull in the contents is now 18 MB in size. I was able to compress it down to 7.4 MB with the help of jq but still, my builds fail. That is on Netlify with:
...
Jekyll Feed: Generating feed for posts
◈ Netlify Dev could not connect to localhost:4000.
◈ Please make sure your framework server is running on port 4000
and locally with:
Jekyll Feed: Generating feed for posts
/usr/lib/ruby/3.0.0/erb.rb:259: warning: already initialized constant ERB::Revision
/home/user/.gem/ruby/3.0.0/gems/erb-2.2.3/lib/erb.rb:260: warning: previous definition of Revision was here
/usr/lib/ruby/3.0.0/erb.rb:367: warning: already initialized constant ERB::Compiler::Scanner::DEFAULT_STAGS
/home/user/.gem/ruby/3.0.0/gems/erb-2.2.3/lib/erb.rb:369: warning: previous definition of DEFAULT_STAGS was here
/usr/lib/ruby/3.0.0/erb.rb:368: warning: already initialized constant ERB::Compiler::Scanner::DEFAULT_ETAGS
/home/user/.gem/ruby/3.0.0/gems/erb-2.2.3/lib/erb.rb:370: warning: previous definition of DEFAULT_ETAGS was here
/usr/lib/ruby/3.0.0/erb.rb:489: warning: already initialized constant ERB::Compiler::TrimScanner::ERB_STAG
/home/user/.gem/ruby/3.0.0/gems/erb-2.2.3/lib/erb.rb:491: warning: previous definition of ERB_STAG was here
/usr/lib/ruby/3.0.0/erb.rb:830: warning: already initialized constant ERB::NOT_GIVEN
/home/user/.gem/ruby/3.0.0/gems/erb-2.2.3/lib/erb.rb:832: warning: previous definition of NOT_GIVEN was here
done in 645.602 seconds.
Auto-regeneration: enabled for '/home/user/Repositories/website'
Sometimes, locally, I get the same error as on netlify.
If I use a smaller version of my JSON data file, the build works as expected.
So, I am wondering, is there a maximum file size limit for data files? I was not able to find any information on that topic.
Your netlify dev command says it needs Jekyll to be running so focus on fixing Jekyll
What I tend to do when facing a weird error is remove possible causes. Like make your JSON files empty and rebuild/serve.
Then comment out your config.
Keep going until your error disappears and you have found your file that causes the error.
Or start with an empty repo and add a config and JSON files into there and like one HTML page. And keep adding more JSON content until you find the one that breaks stuff.
Can you share a link to the repo so we can reproduce the error?