Logo with infinity symbol on it.

Anant's Social Feed

Anant Shrivastava aka anantshri . @anant,

Lets see how real life debugging works:

  1. vercel deployment fails with and error
1. Error in your Eleventy config file '.eleventy.js'. You may need to run `npm install`. (via EleventyConfigError)

further down the line

[11ty] Original error stack trace: Error: Cannot find module '@11ty/eleventy-img'

All the errors point to 11ty config issues.

Lets see what the project is doing. We were using 11ty to deploy a set of markdown files on a server. vercel was used to build the package.

Debugging steps taken:

  1. Lets deep dive into what changed recently.
    a. project owner was experimenting with disabling vercel robot comments on each commit as it was adding too much noise on mails.
    so they edited vercel.json to add github silent.

While they were at it, they have been bugged about adding no index header on vercel config too. so they did that too. JSON was ran through a json validator to see if any error exists in it. NO ERROR Reported.

b. upstream project that of ours have recently added eleventy-img as a dependency and around the same time as owner did the above changes they merged the upstream changes back in code.

All fingers pointing to:

  1. upstream screwed up.
  2. something got missed in the eleventy config.

Next set of debugging.

  1. lets clone project locally and see if we can replicate npm install or npm run build error log.
  2. No error on local machine and it gets working properly.

This rules out eleventyconfig errors.

Now suspects are

  1. Vercel server not refreshing cache and hence not able to deploy properly due to new npm module in picture
  2. Some other error at vercel end.

Final error identification:

Somehow the header addition on the vercel.json started causing error. once we removed that block the code worked flawlessly.

#debugging #wierd #devops

Open thread