eleventy
eleventy copied to clipboard
[WARNING] for errors in CI allows build to succeed
Operating system
ubuntu:20.04
Eleventy
2.0.1
Describe the bug
I currently have a site that is being built with AWS Amplify, recently a stale PR got merged in that had some old frontmatter that was no longer valid (attempting to look for an old layout file). I got the error during the build phase in the CI as expected, but since it outputs as a [WARNING] and not an error the build phase was considered successful and the site continued to deploy without content causing an empty site to be deployed.
Output from followup testing:
2024-02-20T15:37:58.251Z [WARNING]: [11ty] You’re trying to use a layout that does not exist: doesnt-have-one.njk (undefined) (via Error)
2024-02-20T15:37:58.251Z [WARNING]: [11ty]
[11ty] Original error stack trace: Error: You’re trying to use a layout that does not exist: doesnt-have-one.njk (undefined)
...
It is worth noting that this fails as expected locally, but not in the CI environment.
This is private code but I would be happy to spin up a bare bones example to provide more context here, but I think the issue is fairly straight forward.
Reproduction steps
This is tough since it's a specific case to amplify
- Create a site
- Add frontmatter to a markdown file
layout: not-real.njk - Push the code up to amplify to build
- Code should deploy as if there was no error
Expected behavior
I'd expect this to be an error and not a warning since the site isn't truly being built. Currently I have a custom build script that run and logs any output like this as an error to a text file and check that file prior to the deploy step to fail the builds if the file has content.
Reproduction URL
No response
Screenshots
No response