Frontmatter delimiter must be followed by CR+LF or LF

I’ve hit a dead end trying to import html into my first draft hugo site. The WordPress import worked well. But hand made md files give me this error regardless of what I do to try to fix it. I’ve put a LF everywhere I can thing of assuming I’m not understanding where it needs to go. The hint filepos 258 (the position referred to in this particular post below.), tells me nothing. I can’t find an explanation of the location. Here is a header example that produces the error. You will note I put in extra LFs to try to fix it.


date = "2015-12-10T15:16:54-06:00"
title = "How to Break a Bad Habit, Like Cigarette Smoking"
author = "David Earl Johnson, MSW, LICSW"
categories = [“Bad Habits”,“Addiction”, “Substance Abuse”]
url = "/cigarette-smoking"
type = “article”


Thanks in advance.

Things that may, or may not, be relevant:

  • Your exact version of Hugo
  • Your operating system
  • The newline setting in your text editor (DOS \r\n, UNIX \n?)

It might be helpful to upload one of the files that is giving you errors, so that we can look at the exact same file.

I’m not sure where to look for the version, but it was downloaded late in January. so if not the latest, it’s close. I’m running it in Win10 in Bash, also recent download. I use Editplus3 as a code editor. It tells me its /n even though I’m not in Unix.

Here is the complete md for the header above.


date = "2015-12-10T15:16:54-06:00"
title = "How to Break a Bad Habit, Like Cigarette Smoking"
author = "David Earl Johnson, MSW, LICSW"
categories = [“Bad Habits”,“Addiction”, “Substance Abuse”]
url = "/cigarette-smoking"
type = “article”


This is a cross post from a © 2013 who welcomes republishing of their content on condition that you credit Choose Help and the author, David Earl Johnson, MSW, LICSW. This article is licensed under a Creative Commons License.

Bad habits come in many different forms. There are minor and major bad habits. Minor bad habits include procrastination, fidgeting, overspending, and nail biting for example. Major bad habits include drinking, drug abuse, smoking and gambling. The major bad habits are all very serious habits that have been associated with addiction and health consequences.

All habits are difficult to break. Habits always produce a payoff that reinforces the behavior and consequences that create a pushback, an incentive to change. The more times the payoff occurs the more difficult the habit is to change. The more serious the push back, the more incentive there is to change.

Major bad habits are often said to be physically addictive in that repeated use creates an increased tolerance for the drug that increases the dose requirement to produce the same high. Addictions also produce a withdrawal syndrome whenever the user stops using that discourages quitting.

The more addictive qualities of the drug or the habit, the more difficult it is to change. Even habits that are considered nonphysical addictions, like gambling, seem to have similar tolerance and withdrawal effects.

Change Is Possible

From 1965 to 2010, the prevalence of cigarette smoking among adults in the United States decreased from 42.4% to 19.3%. Since 2002, the number of former U.S. smokers has exceeded the number of current smokers. In the 1950 the number of male smokers in the U.S. was over 50%, now the number of men smoking is just over 20%1. While the progress is significant, there is still a lot of work to go.

Let me tell you my experience many years ago. I smoked a pack of cigarettes a day for over 15 years. Jokingly, I’d tell people that it wasn’t a problem for me. I could quit anytime I wanted to. Quitting is easy for me. I quit hundreds of times. Unfortunately, that was all too true. After 15 years of smoking, I had quite a hacking cough and every time I got a cold it quickly turned into bronchitis. It was clear to me that smoking was going to kill me at a young age if I didn’t quit. My final drive to quit extended over at least two years. Every night I finished my pack of cigarettes just before I went to bed. By the next morning I was craving again and by noon I had bought another pack of cigarettes. Finally I realized I was playing a game with myself. I really did want to quit but perhaps I wasn’t quite ready to do so.

My cigarette problem was actively interacting with a comfort eating problem. There had been many times I had given up quitting because I was gaining so much weight. So clearly, the problem here wasn’t just about one bad addictive habit. I had two habits, smoking and comfort eating that I was using to manage the fact I wasn’t comfortable in my own skin. I needed to make significant progress with that problem before I took on smoking.

Preparing for Change

So I put off quitting smoking until I was ready to take on the challenge. Over the next year I worked on my self-esteem, my body image, did some serious thinking about where I wanted my life and my career to go. I set some goals for myself with clear indicators of progress I could watch for and celebrate.

After that year, I felt pretty good about myself, my life and my world. I finally felt ready to tackle smoking. Recognizing that smoking and comfort eating were part of the same problem, I decided on a two pronged approach. I would quit smoking and change my eating habits.

The Change Plan: My Story

This time I quit in the middle of a pack of cigarettes. Part of the game I played with myself was that I managed my lack of self-discipline by finishing all the cigarettes in the house before. I was determined to do better this time. I put that half-smoked pack of cigarettes next to the chair where I’d sit at home and watch the nightly news. Next to it, I left a dirty ashtray. I’d always found dirty ashtrays to be the most disgusting part of smoking. So naturally I thought if I ever needed to remind myself how much I hated that dirty habit, the dirty ashtray would provide that reminder. If I ever decided to start smoking again, I would have readily available that pack of now stale cigarettes. Anyone who’s been a smoker knows that stale cigarettes make a terrible smoke.

The first few nights, I sat in my chair, turned on the TV to watch the nightly news and, out of habit, I reached over to my pack of cigarettes just like I’d always done for many, many years. I extracted one from the pack and brought it to my mouth and picked up my trusty lighter to light it up. It was at that point that I realized that I had quit. I put the lighter down, the cigarette back in the pack. That’s a lot of automatic behavior that will have to be gradually wound down.

For the next several nights, I picked up that pack of cigarettes and put a cigarette in my mouth and reached for the lighter and then realize I’d quit. Every day over a three week period, that behavior unwound earlier and earlier until finally I would just glance at the pack of cigarettes and realize that I’d quit.

I was pretty proud of myself, but I realized after so many failed attempts that lasted several weeks or even months, I was still not done with the process of quitting. I knew, in a way, I was self-medicating my discomfort with cigarettes and comfort food. So far all was going well, I had remained smokefree and maintained my new eating habits for a month. And I had lost 14 lbs too! Success can produce some momentum that carries though some difficult times.

But I knew the biggest challenge was yet to come. I had not experienced a really bad day, one that would challenge my newly acquired sense of balance. Knowing this, that pack of cigarettes and ashtray remained where I would see them every day reminding me that I could always choose to start again and how unpleasant that choice would be.

The Challenge Day

That day came two or three months later. I had had a very bad day. I was mad at the world, frustrated with myself, and believed I was entitled to a crutch to get through the day. I decided that I was going to smoke again. I picked up that stale pack of cigarettes, pulled one out, lit it up, took a deep breath. That triggered a fit of coughing and nausea from the stale taste. I angrily stubbed out that cigarette, threw away that pack of cigarettes and lighter, and cleaned the ashtray. I put that ashtray high up in a closet out of sight and mind. I never touched a cigarette again.

Overcoming Bad Habits

Bad habits can be changed. But it takes a commitment that extends well beyond the habit itself. For every habit, especially the addictive habits, there is:

    <li>A repeated payoff that maintains the habit and a push back that is insufficient to inspire change.  </li>
    <li>There  is also an existential reason a person engages in a bad habit, such as compensating for low self-esteem, an uncomfortable living circumstance, or feeling prevented from working on goals.     </li>
    <li>The habit usually serves one or more additional purposes that help maintain the habit and that at times may be a bigger barrier than the addiction itself. </li>

Changing a bad habit requires a good understanding of one’s self so that one can target the purpose the habit serves in one’s life. Changing the habit requires patience and building up alternative positive coping habits. Quitting is largely a matter of patience, persistence and determination that ensures the outcome.

When to Get Help

It’s important to know when you can’t take on the habit by yourself and when it’s time to seek help. If the consequences of your bad habit or the effort to break the habit interferes with relationships, income and survival, the problem is more than one person can handle. Formal treatment should be initiated.

Hi Dave;

I meant to actually attach it as a file:

When you copy and paste the text into the forum, it will automatically “fix” all the newlines to suit itself, destroying the evidence we’re trying to look at. :slight_smile:

FYI, I copied a fragment of your text into a local Hugo site on my Windows 10 machine, and it worked fine. I saved my file with DOS/Windows newlines (CR/LF) and ran Hugo from Powershell and it worked.

I suspect that you may be getting strange errors because you are mixing:

  1. a Windows text editor (which is probably saving DOS newlines)
  2. bash, a Linux shell which probably expects Unix newlines.

I’d suggest retrying, making sure your editor is saving CR/LF line endings, and using entirely Windows-native tools. This includes deleting your current installation of Hugo, and installing the very latest Windows 64-bit version.

1 Like

You made my day! That was the issue apparently. Thanks!:smiley:

I have the same error, but can not find the location of the problem.

The error I get is: “Error: Error building site: frontmatter delimiter must be followed by CR+LF or LF but those can’t be found at filepos 302”

Maybe a stupid question, but what is filepos 302? (file position? error position in a file? 302th file?)

UPDATE: The error doesn’t show a file name (e.g. page-name.html). I’m using .html pages.

I converted 3 other websites from PHP to HTML with Hugo in the same way, but without any problems.

I use Notepad ++ and it shows Windows (CR LF) at the bottom (just like on the screenshot).

I checked, but can not find the problem.

I’m using Windows 10 (Fall Creators Update), Hugo version Hugo 0.37.1 and Windows Command Prompt (Admin).

UPDATE: Ok, so I have found the problem. I left a space after — on my _index.html file. After removing the space, the error is gone.