Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eleventy 1.0.1-canary.3 tries to process my config files even though I've told it not to #2267

Closed
MWDelaney opened this issue Mar 8, 2022 · 4 comments
Assignees
Labels
bug release: canary A release on the canary channel

Comments

@MWDelaney
Copy link

Describe the bug
I believe this is due to the intricacies of my setup, but here we go anyway:
On the ZeroPoint dev branch I've configured two custom template languages, scss and js.

Upgrading from 1.0 to 1.0.1-canary.3 causes the previously working template language configs to fail with errors similar to the following:

[11ty] 1. Having trouble rendering js template ./src/config/collections.js (via TemplateContentRenderError)
[11ty] 2. Having trouble compiling template ./src/config/collections.js (via TemplateContentCompileError)
[11ty] 3. Cannot use 'in' operator to search for 'then' in undefined (via TypeError)

This appears to be because Eleventy is ignoring the json file I put in the config directory which had been working to exclude config in 1.0.

This is a difficult situation to describe helpfully so please let me know what I can do to better illuminate the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Clone ZeroPoint and checkout the dev branch
  2. Upgrade Eleventy to 1.0.1-canary.3 in package.json and run npm install to install the updated dependencies
  3. Run npm run dev
  4. See error

Expected behavior
Eleventy 1.0.1 should ignore the javascript files in config like 1.0 did

Environment:

  • OS and Version: Mac
  • Eleventy Version 1.0 and 1.0.1-canary.3

Thanks!

@MWDelaney MWDelaney changed the title Eleventy 1.0.1-canary.3 tries to process my config files even though I've tried to tell it not to Eleventy 1.0.1-canary.3 tries to process my config files even though I've told it not to Mar 8, 2022
@pdehaan
Copy link
Contributor

pdehaan commented Mar 10, 2022

Weird.
I was able to reproduce in 1.0.1-canary.3 and 2.0.0-canary.2, but not in 1.0.0.
But if I remember correctly, I was seeing the error in my log was "./src/config/filters.js"

@schneyra
Copy link

I have a similar error in 2.0.0-canary.4 with my custom extension handler for .scss-files. It tries to compile files that should not be compiled.

@zachleat zachleat added this to the Eleventy 1.0.1 milestone Apr 9, 2022
@zachleat zachleat added bug and removed needs-triage labels Apr 10, 2022
@zachleat zachleat self-assigned this Apr 14, 2022
@zachleat
Copy link
Member

There are a few different ways to opt out processing a template. Note that permalink: false does not opt out of processing (only prevents writing a template to disk) and is superfluous if you’re already ignoring a template.

Typically you’d added a glob to via standard ignore conventions (.eleventyignore or eleventyConfig.ignores): https://www.11ty.dev/docs/ignores/

But, in this specific case, you can return a falsy value from the compile function in your custom template language options. AND we had a regression in the fix for #2217 for this specific issue, so I appreciate you filing it! Definitely want to get this patched for 1.0.1.

Related: https://www.11ty.dev/docs/languages/custom/#compile

@zachleat
Copy link
Member

This will ship with 1.0.1 and 2.0.0-canary.5

zachleat added a commit that referenced this issue Apr 15, 2022
(cherry picked from commit 5def7d8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release: canary A release on the canary channel
Projects
None yet
Development

No branches or pull requests

4 participants