I think an unusual meta tag is breaking my builds

My site is midsouthcoatings.netlify.app. I’m using it right now to submit some HTML banner ads for approval. The ads require a meta tag so they can be submitted to the ad publisher.

The meta tag is: <meta name=”ad.size” content=”width=300,height=250”> .

My builds work fine until I include this. But when I do it seems to cause a parse error. I include an edited log file. (The whole log file is more than 200,000 characters over the length limit.)

My main question: Is there something about this meta tag that Netlify doesn’t like? Or is there something else breaking the build?

Here’s the log:

1:50:55 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
1:50:55 PM: build-image tag: v3.3.20
1:50:55 PM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
1:50:55 PM: Fetching cached dependencies
1:50:55 PM: Starting to download cache of 309.9MB
1:50:57 PM: Finished downloading cache in 2.406974196s
1:50:57 PM: Starting to extract cache
1:51:11 PM: Finished extracting cache in 13.52319945s
1:51:11 PM: Finished fetching cache in 16.058349329s
1:51:11 PM: Starting to prepare the repo for build
1:51:11 PM: Netlify Large Media is enabled, running git commands with GIT_LFS_SKIP_SMUDGE=1
1:51:11 PM: Preparing Git Reference refs/heads/master
1:51:13 PM: Starting build script
1:51:13 PM: Installing dependencies
1:51:13 PM: Python version set to 2.7
1:51:14 PM: Started restoring cached node version
1:51:19 PM: Finished restoring cached node version
1:51:19 PM: Attempting node version '10' from .nvmrc
1:51:19 PM: v10.21.0 is already installed.
1:51:20 PM: Now using node v10.21.0 (npm v6.14.4)
1:51:20 PM: Started restoring cached build plugins
1:51:20 PM: Finished restoring cached build plugins
1:51:20 PM: Attempting ruby version 2.6.2, read from environment
1:51:22 PM: Using ruby version 2.6.2
1:51:22 PM: Using PHP version 5.6
1:51:22 PM: 5.2 is already installed.
1:51:22 PM: Using Swift version 5.2
1:51:22 PM: Started restoring cached node modules
1:51:22 PM: Finished restoring cached node modules
1:51:23 PM: Started restoring cached go cache
1:51:25 PM: Finished restoring cached go cache
1:51:25 PM: Installing Go version 1.12
1:51:25 PM: unset GOOS;
1:51:25 PM: unset GOARCH;
1:51:25 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
1:51:25 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
1:51:25 PM: go version >&2;
1:51:25 PM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
1:51:25 PM: go version go1.12 linux/amd64
1:51:25 PM: Installing missing commands
1:51:25 PM: Verify run directory
1:51:26 PM: ​
1:51:26 PM: ┌─────────────────────────────┐
1:51:26 PM: │        Netlify Build        │
1:51:26 PM: └─────────────────────────────┘
1:51:26 PM: ​
1:51:26 PM: ❯ Version
1:51:26 PM:   @netlify/build 2.0.27
1:51:26 PM: ​
1:51:26 PM: ❯ Flags
1:51:26 PM:   deployId: 5f0a0a0dd26fdd00071d6278
1:51:26 PM:   mode: buildbot
1:51:26 PM: ​
1:51:26 PM: ❯ Current directory
1:51:26 PM:   /opt/build/repo
1:51:26 PM: ​
1:51:26 PM: ❯ Config file
1:51:26 PM:   /opt/build/repo/netlify.toml
1:51:26 PM: ​
1:51:26 PM: ❯ Context
1:51:26 PM:   production
1:51:26 PM: ​
1:51:26 PM: ❯ Loading plugins
1:51:26 PM:    - @netlify/plugin-sitemap@0.3.4 from netlify.toml and package.json
1:51:26 PM: ​
1:51:26 PM: ┌────────────────────────────────────┐
1:51:26 PM: │ 1. build.command from netlify.toml │
1:51:26 PM: └────────────────────────────────────┘
1:51:26 PM: ​
1:51:26 PM: $ eleventy
1:51:28 PM: Writing _site/admin/index.html from ./admin/index.html.
1:51:28 PM: Writing _site/msc-ads/msc-728x90/index.html from ./msc-ads/msc-728x90/index.html.
1:51:28 PM: Writing _site/msc-ads/MSC-300x250/index.html from ./msc-ads/MSC-300x250/index.html.
1:51:28 PM: Error writing templates: (more in DEBUG output)
1:51:28 PM: > Having trouble writing template: _site/msc-ads/msc-300x250-revision01/index.html
1:51:28 PM: `TemplateWriterWriteError` was thrown
1:51:28 PM: > Parse Error: <meta name=”ad.size” content=”width=300,height=250”>
1:51:28 PM:   <style>gwd-page{display:block}.gwd-inactive{visibility:hidden}</style>
1:51:28 PM:   <style>.gwd-pagedeck{position:relative;display:block}.gwd-pagedeck>.gwd-page.transparent{opacity:0}.gwd-pagedeck>.gwd-page{position:absolute;top:0;left:0;-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:transform,opacity;transition-property:transform,opacity}.gwd-pagedeck>.gwd-page.linear{transition-timing-function:linear}.gwd-pagedeck>.gwd-page.ease-in{transition-timing-function:ease-in}.gwd-pagedeck>.gwd-page.ease-out{transition-timing-function:ease-out}.gwd-pagedeck>.gwd-page.ease{transition-timing-function:ease}.gwd-pagedeck>.gwd-page.ease-in-out{transition-timing-function:ease-in-out}.linear *,.ease-in *,.ease-out *,.ease *,.ease-in-out *{-webkit-transform:translateZ(0);transform:translateZ(0)}</style>
...
...
...
1:51:47 PM:   </gwd-genericad>
1:51:47 PM:   <script type="text/javascript" id="gwd-init-code">
1:51:47 PM:     (function() {
1:51:47 PM:       var gwdAd = document.getElementById('gwd-ad');
1:51:47 PM:       /**
       * Handles the DOMContentLoaded event. The DOMContentLoaded event is
       * fired when the document has been completely loaded and parsed.
       */
1:51:47 PM:       function handleDomContentLoaded(event) {
1:51:47 PM:       }
1:51:47 PM:       /**
       * Handles the WebComponentsReady event. This event is fired when all
       * custom elements have been registered and upgraded.
       */
1:51:47 PM:       function handleWebComponentsReady(event) {
1:51:47 PM:         // Start the Ad lifecycle.
1:51:47 PM:         setTimeout(function() {
1:51:47 PM:           gwdAd.initAd();
1:51:47 PM:         }, 0);
1:51:47 PM:       }
1:51:47 PM:       /**
       * Handles the event that is dispatched after the Ad has been
       * initialized and before the default page of the Ad is shown.
       */
1:51:47 PM:       function handleAdInitialized(event) {}
1:51:47 PM:       window.addEventListener('DOMContentLoaded',
1:51:47 PM:         handleDomContentLoaded, false);
1:51:47 PM:       window.addEventListener('WebComponentsReady',
1:51:47 PM:         handleWebComponentsReady, false);
1:51:47 PM:       window.addEventListener('adinitialized',
1:51:47 PM:         handleAdInitialized, false);
1:51:47 PM:     })();
1:51:47 PM:   </script>
1:51:47 PM: </body></html>
1:51:47 PM: `Error` was thrown:
1:51:47 PM: ​
1:51:47 PM: ┌─────────────────────────────┐
1:51:47 PM: │   "build.command" failed    │
1:51:47 PM: └─────────────────────────────┘
1:51:47 PM: ​
1:51:47 PM:   Error message
1:51:47 PM:   Command failed with exit code 1: eleventy
1:51:47 PM: ​
1:51:47 PM:   Error location
1:51:47 PM:   In build.command from netlify.toml:
1:51:47 PM:   eleventy
1:51:47 PM: ​
1:51:47 PM:   Resolved config
1:51:47 PM:   build:
1:51:47 PM:     command: eleventy
1:51:47 PM:     commandOrigin: config
1:51:47 PM:     environment:
1:51:47 PM:       - NETLIFY_LFS_ORIGIN_URL
1:51:47 PM:     publish: /opt/build/repo/_site
1:51:47 PM:   plugins:
1:51:47 PM:     - inputs: {}
1:51:47 PM:       origin: config
1:51:47 PM:       package: '@netlify/plugin-sitemap'
1:51:47 PM: Caching artifacts
1:51:47 PM: Started saving node modules
1:51:47 PM: Finished saving node modules
1:51:47 PM: Started saving build plugins
1:51:47 PM: Finished saving build plugins
1:51:47 PM: Started saving pip cache
1:51:47 PM: Finished saving pip cache
1:51:47 PM: Started saving emacs cask dependencies
1:51:47 PM: Finished saving emacs cask dependencies
1:51:47 PM: Started saving maven dependencies
1:51:47 PM: Finished saving maven dependencies
1:51:47 PM: Started saving boot dependencies
1:51:47 PM: Finished saving boot dependencies
1:51:47 PM: Started saving go dependencies
1:51:49 PM: Finished saving go dependencies
1:51:49 PM: Error running command: Build script returned non-zero exit code: 1
1:51:49 PM: Failing build: Failed to build site
1:51:49 PM: Finished processing build request in 54.53889625s

hey there, it does seem like this isn’t working because of the meta tag, you are right.

questions:

  • does this work when you build locally?
  • is snippet injection a possible solution for you?

Thanks for your reply, perry! Yes, the pages build locally even with the meta tag. (They are created in Google Web Designer, but they are on a site that builds with Eleventy, locally and on Netlify. These pages are plain HTML though. No real build step for them.)

I read the “snippet injection” article without fully understanding it. I’d love to see a real-life example. I’ll try to read it again before the next batch of banners. It does sound like a good solution, I’m just not clear how to implement it.

so basically, snippet injection allows you to “inject” a “snippet” (ie. a code chunk, in your case, a specific meta tag, into each/the page without it needing to be included in the source code at build time. You can use it for images, headers, meta tags, kind of whatever you want.

I don’t think we have an example per se to show you (as when you see it at browse time, you wouldn’t even notice the difference) but maybe the best way to see if it would work for you is to build a little test project and fiddle around with it a bit. It is quite easy to set up, actually. Thoughts?

I’ll certainly try it on another project. For this one I really need that meta tag in the file, as that file is what I send off to the people who actually place the ads. I’m using Netlify to show the ads to the creative directors for approval. They actually don’t need to see the meta tags. So it’s not the right solution for the problem I’m having this instant.

It’s easy enough to paste the tags in after approval; it’s just one of those tasks that’s bound to get overlooked, and then the ad gets rejected.

I really just wonder why that meta tag, “ad.size”, breaks the build. I’m guessing the period.

I am guessing it is the period as well! If you need any more assistance, let us know. Sorry we couldn’t be more helpful at this time.