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

Plugin resources assets not loaded in Craft Cloud environment #270

Closed
svale opened this issue Aug 8, 2024 · 7 comments
Closed

Plugin resources assets not loaded in Craft Cloud environment #270

svale opened this issue Aug 8, 2024 · 7 comments
Labels

Comments

@svale
Copy link

svale commented Aug 8, 2024

Bug Description

Hi,

I'm not sure if this is an issue that should be logged here or with Craft Cloud.

It seems the plugin asset resources (CSS and JS) are not loaded when our CP is deployed to Craft Cloud environments

image image

The plugin works as expected in the local DDEV env.

We have logged a similar report with Wrav oEmbed


System:
Craft Pro 5.3.0.3

Plugins
Amazon S3 2.2.1
Asset Usage 4.0.0
CKEditor 4.1.0
Embedded Assets 5.1.1
Expanded Singles 3.0.0
Feed Me 6.2.1
Field Manager 4.0.2
Formie 3.0.0
Hyper 2.0.3
Imager X 5.0.1
Imager X Craft Cloud Transformer 1.0.0-beta.1
Many to Many 4.0.0
oEmbed 3.0.9
Retcon 3.2.0
SEO 5.1.1
Sprig 3.2.1
Vite 5.0.0

Steps to reproduce

  1. Set up a Craft 5 site with the craft-embed-assets plugin
  2. Deploy to a Craft Cloud environment
  3. Try to embed video

Expected behaviour

Plugin resources (CSS/JS) should be loaded

Embedded Assets version

5.1.1

Craft CMS version

5.3.0.3

@svale svale added the bug label Aug 8, 2024
@timkelty
Copy link

@ttempleton Please reach out if you need any help. Here or @timkelty on Discord.

@svale
Copy link
Author

svale commented Aug 12, 2024

FWIW, perhaps not the same under the hood, but a similar issue has been resolved here: wrav/oembed#158 (comment)

If it can be of any help 🤞

@reganlawton
Copy link

Following @svale comment. If you need context on why my fixes work, you can hit me on Discord @reganlawton

@ttempleton
Copy link
Contributor

ttempleton commented Aug 15, 2024

Thanks everyone. I've just enquired regarding Craft Cloud access, and will update here with any updates/questions.

@timkelty
Copy link

@ttempleton The quickest change to get things working is to change any getPublishedUrl tags from this:

	{% set previewCss = view.getAssetManager().getPublishedUrl('@spicyweb/embeddedassets/assets/preview/dist/styles/preview.css', true) %}

to this:

	{% set previewCss = view.getAssetManager().getPublishedUrl('@spicyweb/embeddedassets/assets/preview/dist/', true, 'styles/preview.css') %}

Eg, https://github.com/verbb/formie/pull/1859/files

That said, in most cases, the proper way to do this is to simply call registerAssetBundle from the controller and not try and render the script/css tags yourself.

@ttempleton
Copy link
Contributor

Thanks for that @timkelty!
@svale that is now working in Embedded Assets 4.1.2 and 5.1.2.

@svale
Copy link
Author

svale commented Aug 20, 2024

Thanks @timkelty - much appreciated :)

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

No branches or pull requests

4 participants