-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking: js-yaml bump from v3 to v4 for better error messaging for tabs versus spaces in YAML front matter #2126
Comments
So this turned out to be a tab in my front matter. I swear I remember Eleventy throwing errors (or messages) in the past when it detected a tab in front matter, so is it a bug that the error wasn't shown? |
I had the same problem yesterday. I couldn't figure out why. I added the redirect manually. |
It happened to me as well 😔 I got an error that wasn’t helpful. Tabs in the front matter caused it (indent before
Here’s the log
I wonder if it’s possible to allow tabs in the front matter, instead of throwing errors. I know, I know… But it would make 11ty friendlier to any code style. Right now if you want to use tabs in your project, you have to mix them with spaces only for the front matter. Unfortunately, such a mix is impossible to configure or test via EditorConfig. |
Yes, that was a very confusing error - thank you for posting the log @pepelsbey or I might never have figured it out. |
Wouldn't this be an upstream issue for https://github.com/jonschlinkert/gray-matter, which handles the front matter parsing for Eleventy? |
Why not both? Eleventy could give an error message along the lines of "Error parsing frontmatter in file XYZ", and gray-matter could give an error message about mixing tabs and spaces. |
There was an obscure internal regression in the error messaging here. I patched it up and @pepelsbey’s test above reported the following expected error:
However, in running a few more tests it looks like the An upgrade to That makes this issue a breaking change as we’re bumping the default yaml parser a major version, shipping with 3.0.0-alpha.15.
The
|
Not sure why this use of tabs instead of spaces was never picked up previously. Maybe Eleventy 3 handles frontmatter a bit more strictly? Seems likely related to 11ty/eleventy#2126 (comment)
Describe the bug
Hi, sorry for the double post. I added this to the Discussions board (#2118) thinking maybe I did something simple (and wrong ;) but I haven't seen any responses yet so perhaps it's a proper bug.
My first serverless test is failing because even though netlify.toml is created (once), the redirects are never added. I just have a blank netlify.toml file.
My config:
Output from running
npx eleventy
:As I said, if I remove netlify.toml, it gets generated, but it's empty. My serverless function was created thoujgh.
Environment:
eleventy --version
ornpx @11ty/eleventy --version
] 1.0.0-beta.8The text was updated successfully, but these errors were encountered: