Eleventy: .gitignore causes "AssertionError: tag ab not found"

Created on 17 May 2020  ·  2Comments  ·  Source: 11ty/eleventy

Might be related to #318?

I'm new to Eleventy and these were the first commands I have ever run to set it up:

$ mkdir example.com
$ cd example.com
$ yarn add  dev @11ty/eleventy

# Realized I probably will need to install globally to work properly with Yarn..

$ yarn add global @11ty/eleventy
$ echo '<!doctype html><html><head><title>Page title</title></head><body><p>Hi</p></body></html>' > index.html
$ echo '# Page header' > README.md
$  git init

Proceeded to open the directory in WebStorm, added a .gitignore manually with the following:

.IDEA
.node_modules
_site

Then back in terminal ran eleventy and got the following error:

➜  example.com git:(master) ✗ eleventy
Problem writing Eleventy templates: (more in DEBUG output)
> Having trouble rendering liquid (and markdown) template ./node_modules/decode-uri-component/readme.md

`TemplateContentRenderError` was thrown
> Having trouble compiling template ./node_modules/decode-uri-component/readme.md

`TemplateContentCompileError` was thrown
> tag ab not found, file:./node_modules/decode-uri-component/readme.md, line:44

`ParseError` was thrown
> tag ab not found

`AssertionError` was thrown:
    AssertionError: tag ab not found
        at assert (~/.config/yarn/global/node_modules/liquidjs/dist/liquid.common.js:1062:11)

Googled around, deleted the .gitignore after seeing this GH issue, and it seems to have built without issues. Re-adding the .gitignore again causes the same thing.

Also tried with .eleventyignore and using npx instead, just installing locally. Same thing. Wonder if it's a version thing..

I'm on macOS Catalina, Node v10.15.3, Yarn 1.19.2.

needs-triage

Most helpful comment

Hi,

The dot in front of the 2 first lines of your .gitignore file is probably breaking the build. I tested it and after removing that, the errors were gone. So your .gitignore file should look like this instead:

node_modules
_site

I'll refer to https://git-scm.com/docs/gitignore for more detailed information on the .gitignore syntax.

All 2 comments

Hi,

The dot in front of the 2 first lines of your .gitignore file is probably breaking the build. I tested it and after removing that, the errors were gone. So your .gitignore file should look like this instead:

node_modules
_site

I'll refer to https://git-scm.com/docs/gitignore for more detailed information on the .gitignore syntax.

@carlos-ds - Thanks, good catch. Just wanted to add that I did some additional testing since it surprised me that having a dot in .gitignore would break a build, considering it's quite typical.

So, there is nothing wrong with adding a dot in the .gitignore (.idea doesn't cause this error, because this directory exists), rather that I added an invalid directory of .node_modules, when it should have been node_modules.

Closing since the problem was solved. 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smaimon picture smaimon  ·  3Comments

matt-auckland picture matt-auckland  ·  3Comments

ndaidong picture ndaidong  ·  4Comments

proog picture proog  ·  3Comments

nebrelbug picture nebrelbug  ·  3Comments