The most straightforward way to address this would probably be to move the referenced assets to packages/plugin/src/Resources/{css,js} and a corresponding \Solspace\Freeform\Resources\Bundles\TemplateBundle`.
Errors and Stack Trace (if available)
No response
How can we reproduce this?
Render a form using a formatting template that includes resources, eg flexbox.
What happened?
Craft Cloud requires that front-end resources be defined as asset bundles, so it can publish them to the CDN at deploy time.
Freeform ships with Formatting Templates that attempt to load CSS/JS via
view.assetManager.publishedUrl
, but because those are never defined as Asset Bundles, they are never copied to the CDN: https://github.com/solspace/craft-freeform/blob/v5/packages/plugin/src/templates/_templates/formatting/flexbox/index.twig#L2-L3The result is a URL to something like: https://cdn.craft.cloud/{envId}/builds/{buildId}/cpresources/Solspace-Freeform-templates-_templates-formatting-flexbox/_main.css which will be a 404.
The most straightforward way to address this would probably be to move the referenced assets to
packages/plugin/src/Resources/{css,js}
and a corresponding \Solspace\Freeform\Resources\Bundles\TemplateBundle`.Errors and Stack Trace (if available)
No response
How can we reproduce this?
Render a form using a formatting template that includes resources, eg
flexbox
.Freeform Edition
Pro
Freeform Version
5.6.8
Craft Version
5.4.9
When did this issue start?
No response
Previous Freeform Version
No response