Skip to content

Error with decompiled assets in 1.2 #562

Closed

Description

@xitara

I installed a fresh wintercms 1.1.8 and upgraded to 1.2
if I set 'decompileBackendAssets' => true, I get the following error:

File https://tb.tbtest.andoria/modules/backend/widgets/mediamanager/assets/js/mediamanager-browser.js does not exist to be decompiled.

.../modules/backend/helpers/Backend.php line 229

I think, the problem is, there is an URL and not a file-path given in $file. In another 1.1.8 install it works fine.

Tell me, if you need infos about my setup

Activity

  1. changed the title [-]Error with decompiled assets[/-] [+]Error with decompiled assets in 1.2[/+] on May 20, 2022
  2. transferred this issue fromwintercms/metaon May 21, 2022
  3. added
    needs review
    on May 21, 2022
  4. bennothommo commented on May 21, 2022

    @bennothommo
    Member

    @LukeTowers yeah I have the same issue occurring. It's due to the Asset Maker PR that was merged recently, and the fact that now all assets are using a URL. I was meaning to ask Jack or yourself what the change was for.

  5. LukeTowers commented on May 22, 2022

    @LukeTowers
    Member

    @bennothommo it's to support having your assets published on a CDN, specifically on Laravel Vapor it was an issue where any assets added via the AssetMaker trait weren't respecting the asset_url config value and thus weren't loading. We should just be able to add support for the app.asset_url config value to the asset decompiler and it should just work.

  6. bennothommo commented on May 22, 2022

    @bennothommo
    Member

    @LukeTowers ok, gotcha, however, is that needed for assets that are included in the core? I can see the case for plugins, where they may be externally stored, but the ones in core that actually are candidates for decompilation should still be loaded locally? Unless you are moving those externally as well?

  7. LukeTowers commented on May 22, 2022

    @LukeTowers
    Member

    When using a CDN as a part of your deployed Winter instance the idea is for all assets to be served through it, so loading any assets "locally" would be a bit pointless.

    I imagine that the decompiler should be able to just strip off the asset URL before attempting to decompile an asset, no?

  8. bennothommo commented on May 23, 2022

    @bennothommo
    Member

    Sure, we can do that. If the assets are not available locally though, it will fail.

  9. LukeTowers commented on May 23, 2022

    @LukeTowers
    Member

    That should be fine, the asset URL helper should only be adding to assets that are available locally anyways, and you certainly wouldn't actually be using the asset decompiler in an environment like Vapor where the assets might not even be present on the server at all.

  10. added and removed
    needs review
    on May 25, 2022
  11. bennothommo commented on May 25, 2022

    @bennothommo
    Member

    Fixed by 805b95b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions