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

eleventyComputed & permalink: false lost in Canary 1.0 #1754

Closed
TigersWay opened this issue May 3, 2021 · 12 comments · Fixed by #1793
Closed

eleventyComputed & permalink: false lost in Canary 1.0 #1754

TigersWay opened this issue May 3, 2021 · 12 comments · Fixed by #1793
Assignees
Labels

Comments

@TigersWay
Copy link
Contributor

TigersWay commented May 3, 2021

Describe the bug
it seems we lost being able to set permalink:false inside a eleventyComputed.

> Having trouble writing template: false

`TemplateWriterWriteError` was thrown
> The "path" argument must be of type string. Received type boolean (false)

`TypeError` was thrown:
    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type boolean (false)
        at validateString (internal/validators.js:124:11)
...

To Reproduce
somefolder.11tydata.js

module.exports = {
  eleventyComputed: {
    permalink: false
  }
};

Silly example I know, my real code is dealing with drafts or admin pages...
And to be clear this next one is working

module.exports = {
  permalink: false
};

but less useful!

Expected behavior
Same as the official version of course :-) as of today v0.12.1 => no page/document in that 'folder' should be generated.

Environment:

  • Windows 10
  • Eleventy v0.12.1 vs v1.0.0-canary.16
@TigersWay
Copy link
Contributor Author

Did some more tests today....
Confirmed the trouble, and it appeared since the April 9 commit: 1e47d66 but I don't understand it enough to propose a PR 😢

@zachleat
Copy link
Member

Thanks for the report! I’ll have a look

@zachleat zachleat added this to the Eleventy 1.0.0 milestone Jun 2, 2021
zachleat added a commit that referenced this issue Jun 2, 2021
@zachleat
Copy link
Member

zachleat commented Jun 2, 2021

Fix currently resides in zl/serverless branch.

@TigersWay
Copy link
Contributor Author

Just tried, without changing anything else: from v0.12.1 to zl/serverless...

  • I can "now" use permalink:false! Pretty nice, I'm going to be able to work again on drafts and publishing dates.
  • But I have a bunch of "unclassified" (unfinished) markdown files under both eleventyExcludeFromCollections: true and permalink:false where it now seems to break. While they can be ignored I will have to spend some time testing.

Thanks!!!!

@zachleat
Copy link
Member

zachleat commented Jun 2, 2021

@TigersWay can you provide more information about the eleventyExcludeFromCollections: true permalink:false failure? I added a test and it seems to be working ok but I’d love to learn more

@TigersWay
Copy link
Contributor Author

Hard to tell in my current configuration - too many parameters - but it seems the current page page inside a layout is undefined and is not with v0.12.1
Will try to build a small repo around this in the next hours.

Little note: It seems that when there's a breaking error in a layout, DEBUG gives the layout but not the current template.

@TigersWay
Copy link
Contributor Author

@TigersWay can you provide more information about the eleventyExcludeFromCollections: true permalink:false failure? I added a test and it seems to be working ok but I’d love to learn more

You're not going to learn much more here. This is totally my mistake: my ancestry plugin has a bug, easy to correct, and proof again that we can't always think about all the imaginable tests 😊

Hoping for the official release but already closing this issue!

@zachleat
Copy link
Member

zachleat commented Jun 5, 2021

Thanks for following up!

@vnourdin
Copy link

I reproduce the exact same bug (eleventyExcludeFromCollections: true + permalink:false give me The "path" argument must be of type string. error) using Eleventy v1.0.0-beta.2.
Isn't the bugfix included in this version ?

@vnourdin
Copy link

Hi there 👋 I still have this behavior with the 1.0.0 release, any clue ?

@pdehaan
Copy link
Contributor

pdehaan commented Jan 15, 2022

@vnourdin Hhmm, interesting... Can you please file a new issue and include a link to your repo or some source code.

I tried this w/ a directory data file and it's not writing any of the files in my /src/ directory (which is expected):

// ./src/src.11tydata.js
module.exports = {
  tags: ["content"],
  eleventyExcludeFromCollections: true,
  permalink: false,
};

Wondering if there is possibly something else subtly breaking something here.

@11ty/eleventy v1.0.0

@vnourdin
Copy link

vnourdin commented Jan 17, 2022

I set eleventyExcludeFromCollections and permalink in my src/_data/eleventyComputed.js, so maybe the problem is only from within eleventyComputed.
There is already the issue #2167 which may be relative. I'll try to refine the issue and open a new one if it's not the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants