eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

Serverless pages can't access collections

Open cfjedimaster opened this issue 2 years ago • 4 comments

Describe the bug I've got a template being used by the Serverless plugin. It can't seem to access collections.

To Reproduce Try to use collections in a serverless page. :)

Expected behavior That it should work. If it isn't supposed to work, then it should be documented.

cfjedimaster avatar Mar 09 '22 14:03 cfjedimaster

Cross posting discussion from Twitter here https://twitter.com/roobottom/status/1459106529781686285

Notably,

For the record precompiledCollections is a stop gap—the goal is to get collections working on serverless without manual intervention.

zachleat avatar Mar 10 '22 16:03 zachleat

Is this supposed to work with 11ty 1.0.0 ? I reproduced what you shared, but in my serverless page collections is still empty.

vnourdin avatar Apr 03 '22 15:04 vnourdin

@zachleat is there any sort of release version aim for this being included as standard without manual intervention? I'm working on a project that requires this, but don't want to invest too much time if it's something that might be coming shortly.

Thanks as always! ❤️

ryangittings avatar Apr 05 '22 08:04 ryangittings

I ran into this bug too, and @zachleat suggested in https://github.com/11ty/eleventy/issues/2437 that I use Edge functions, which I finally had a chance to try out today.

With them, I'm seeing collections.all is undefined inside of the {% edge "liquid" %} blocks. The branch I used to test is here. Am I doing something wrong, or might there be another regression?

Let me know if I should create a new issue. Thanks again!

lehrblogger avatar Jul 28 '22 23:07 lehrblogger

Stale per project slipstream changes in #3074.

zachleat avatar Apr 09 '24 17:04 zachleat