Skip to content

Global data filename being tags.js throwing error #1791

Open
@tannerdolby

Description

@tannerdolby

Describe the bug
When I have a global data file named tags.js in the _data directory, this odd error is thrown:

Problem writing Eleventy templates: (more in DEBUG output)
> entry.data.tags is not iterable

`TypeError` was thrown:
    TypeError: entry.data.tags is not iterable
        at TemplateMap.getMappedDependencies (/Users/TannerDolby/11ty-portfolio/node_modules/@11ty/eleventy/src/TemplateMap.js:109:38)
        at TemplateMap.cache (/Users/TannerDolby/11ty-portfolio/node_modules/@11ty/eleventy/src/TemplateMap.js:278:30)
        at TemplateWriter._createTemplateMap (/Users/TannerDolby/11ty-portfolio/node_modules/@11ty/eleventy/src/TemplateWriter.js:170:28)

It doesn't seem to be caused by any of my local files, so I was wondering if maybe anyone else encountered something like this. The only thing I could think of quickly was that the tags.js filename is replacing some file local to 11ty with the same name. The error is thrown when the tags.js file has content in it and when its completely empty.

To Reproduce
Steps to reproduce the behavior:

  1. Go to your _data folder
  2. Create a file tags.js
  3. Build eleventy (eleventy)
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
I expected the tags.js filename to be fine as a global data file. I didn't think there were any reserved filenames that couldn't be used so this made me curious.

Screenshots
Screen Shot 2021-05-23 at 11 50 43 PM

Environment:

  • OS and Version: [Mac OS High Sierra v10.13.6]
  • Eleventy Version [v0.11.1]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions