Skip to content

Build process crashes ambiguously if github_username is not found. #27

@lgibson02

Description

@lgibson02

Build process stopped working recently. Error output:

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble rendering njk template ./bloggers.njk (via TemplateContentRenderError)
[11ty] 2. (./bloggers.njk)
[11ty]   EleventyShortcodeError: Error with Nunjucks shortcode `asset` (via Template render error)
[11ty] 3. The "path" argument must be of type string. Received undefined (via Template render error)
[11ty] 
[11ty] Original error stack trace: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
[11ty]     at new NodeError (node:internal/errors:405:5)
[11ty]     at validateString (node:internal/validators:162:11)
[11ty]     at Object.basename (node:path:1308:5)
[11ty]     at Object.filter_asset (/srv/static-sites/hullblogs.com/src/.eleventy.js:28:22)
[11ty]     at Object.<anonymous> (/srv/static-sites/hullblogs.com/node_modules/@11ty/eleventy/src/BenchmarkGroup.js:32:26)
[11ty]     at ShortcodeFunction.run (/srv/static-sites/hullblogs.com/node_modules/@11ty/eleventy/src/Engines/Nunjucks.js:200:14)
[11ty]     at eval (eval at _compile (/srv/static-sites/hullblogs.com/node_modules/nunjucks/src/environment.js:527:18), <anonymous>:22:33)
[11ty]     at iterCallback (/srv/static-sites/hullblogs.com/node_modules/nunjucks/src/runtime.js:236:11)
[11ty]     at next (/srv/static-sites/hullblogs.com/node_modules/nunjucks/src/lib.js:258:7)
[11ty]     at eval (eval at _compile (/srv/static-sites/hullblogs.com/node_modules/nunjucks/src/environment.js:527:18), <anonymous>:80:1)

Directly, this comes from {% asset blogger.url_avatar %} in bloggers.njk when blogger is mssing url_avatar attribute. I believe blogger comes from calling fetch_github_user_info. Error responses from GitHub are not handled in or around this function. If an error response does occur, blogger will just contain the error response JSON which of course is missing all attributes you'd expect from a successful request.

The error here came about because KieranRobinson changed his GItHub username, this was not reflected in the feeds.json. I've updated the file but there should be proper handling added against this sort of case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions