eleventy
eleventy copied to clipboard
getBundle in serverless only running on first invocation
Operating system
macOS Sonoma 14.2.1 (23C71)
Eleventy
2.0.2-alpha.2
Describe the bug
I'm using Eleventy Serverless in dynamic template rendering mode to render previews of the site before they get published in the CMS.
The preview works fine so far. However, only on the first render. As soon as I reload the page or want to preview another document, the CSS and JS that gets generated using getBundle('css') and getBundle('js') are empty.
I'm generating the styles and scripts as follows:
<style @raw="getBundle('css')" webc:keep></style>
...
<script @raw="getBundle('js')" webc:keep></script>
Reproduction steps
- Goto https://11ty-get-bundle-test.netlify.app/preview/modular/?id=page-one
- Reload the page
Expected behavior
getBundle should run on every invocation of serverless function.
Reproduction URL
https://github.com/timonforrer/11ty-get-bundle-test
Screenshots
No response