Decoupled Drupal Dumb Problems: Malformed Markup

February 20, 2018

Mateu has many of the Decoupled Drupal Hard Problems well covered, so I'll take care of one of the dumb ones.

I noticed last weekend that the build was broken for this site - post switching on the homepage wasn't working, and as you scrolled down, posts started to be wrapped in the container for the previous post. I tried a new Gatsby build and saw the same thing. Next, I zeroed in on the post where content started overlapping and eventually noticed that I had some malformed markup in my post in Drupal - a missing closing quote for a href attribute. After updating the post to add the missing quote and doing another build, everything was fine again.

You could chalk most of this up to me - if I was using a wysiwyg editor it would have added the correct link markup for me, and I should probably be taking a closer look at my build after it goes to GitHub Pages. But I think this hiccup was a nice reminder of the reality of these super sexy decoupled architectures. We lose a bit of the protection that Drupal provided us from something like malformed markup in a body field making a page explode. Builds will break in ways that they didn't with Drupal alone - the site worked fine in development mode but broke when the production bundle was built. And while testing is always important, we likely need to test in ways that are different from when we were testing Drupal by itself.

There are lessons to be learned even in the dumbest of problems. I'm sure I'll run into some more.