Never ending build with an Eleventy site

I setup a site to test some Eleventy stuff ( https://hardcore-curie-802f8f.netlify.app/) based on my repo here (https://github.com/cfjedimaster/eleventy-auth0-serverless-mongo). I’ve got eleventy in my package.json and am using npx eleventy for my build command. When I do a build, it just… hangs. It gets to “Building” and never completes. When I look at the output, the last bit is normal Eleventy output, no errors:

1:55:46 PM: $ npx eleventy
1:55:47 PM: Writing _site/films/film-1/index.html from ./films.liquid.
1:55:47 PM: Writing _site/index.html from ./index.liquid.
1:55:47 PM: Writing _site/films/film-2/index.html from ./films.liquid.
1:55:47 PM: Writing _site/films/film-3/index.html from ./films.liquid.
1:55:47 PM: Benchmark (Data): `./_data/films.js` took 663ms (77.0%)
1:55:47 PM: Wrote 4 files in 0.77 seconds (v0.11.0)

Nothing shows up after here. I’ve got multiple other Eleventy sites running fine, it’s just this one that’s hanging.

I finally got a failure due to total time. Still no idea what’s wrong though. :\

You don’t appear to have a build command on your netlify.toml, @cfjedimaster. It only specifies the functions folder. Are you setting that directly in the site’s admin? If so, what are you setting?

Also, when I clone your repo, install the deps, and run npx eleventy as you did above get a Mongo error. Should there be more config and bootstrapping of that? I’m not seeing it captured in the project repo.

Yep, using npx eleventy as my build command. For the Mongo error, I’m using an environment variable that is set in my settings. Running ntl dev locally picks up the variable and runs it fine.

Just to re-iterate, in the log I absolutely see Eleventy running. It says it generates the 4 files. No errors ever show up. The log I shared in my first post is literally the end of the log except when it finally times out and I see: 9:02:10 AM: Build exceeded maximum allowed runtime

Gotcha.

It’s a little hard to replicate since there are bits which seem only to exist via your admin UI. I’ll look a little more at your repo.

What behaviour do you get when you run this locally? Is Eleventy exiting in a timely manner?

Yep. Again, ntl dev works perfectly.

Woot - it’s fixed thanks to Dave Rupert. I never closed my Mongo client. He did a PR that added that and that fixed it immediately. Weird that it worked in ntl dev, but as that process isn’t supposed to end, it also makes a bit of sense too. It all makes sense now I think. Thanks Phil for responding and thanks Dave for the PR.

2 Likes