Giter VIP home page Giter VIP logo

Comments (8)

khalwat avatar khalwat commented on August 25, 2024

Check your error logs -- there most likely is an error from Twigpack stating that it can't find the manifest file.

Is the manifest.json really at @webroot/manifest.json?

from craft-twigpack.

proimage avatar proimage commented on August 25, 2024

There are no error logs per se; just the web.log as stated in the OP.

And no, manifest.json isn't anywhere... it's mix-manifest.json, and it is accessible from example.com/mix-manifest.json.

from craft-twigpack.

khalwat avatar khalwat commented on August 25, 2024

I see several places in the code where errors should be logged:

If it can't find the module entry you're asking for: https://github.com/nystudio107/craft-plugin-manifest/blob/af2cd16f3a199314b9afba3b31c49afc8bbb50b5/src/services/ManifestService.php#L311

If it can't find the manifest file: https://github.com/nystudio107/craft-plugin-manifest/blob/af2cd16f3a199314b9afba3b31c49afc8bbb50b5/src/services/ManifestService.php#L348

If nothing is output, an error should be logged, I'd think.

from craft-twigpack.

proimage avatar proimage commented on August 25, 2024

Like I said above, there's no error logs (i.e. error.log files), but there IS the error in web.log. Did you miss that in the first post? You need to scroll it to the right to see the error message... ;)

from craft-twigpack.

khalwat avatar khalwat commented on August 25, 2024

2022-07-28 14:22:10 [-][123042][-][error][nystudio107\twigpack\helpers\Manifest::reportError] Manifest file not found at: @webroot/assets/

It's looking for your manifest file in @webroot/assets/mix-manifest.json -- why, I'm not sure. Perhaps you don't clear caches on deploy, and it's cached?

Put it there, and it should work as expected.

from craft-twigpack.

proimage avatar proimage commented on August 25, 2024

Right, but here's the second layer of this conundrum:

When mix-manifest.json is located under the @webroot/assets/ directory, then the paths to the compiled assets inside mix-manifest.json are not root-relative, but /assets/-relative:

{
    "/js/app.js": "/js/app.js?id=4078d3bacd5bec58043bdcf2919fe0b2",
    "/css/all.css": "/css/all.css?id=1358f72d4f09b6629328c29d336d4540",
}

Twigpack handles that fine when the useAbsoluteUrl option is true, but when that setting is false, it just outputs the paths found in the manifest file. This means the site HTML has this:

<!-- Wrong URL -->
<link rel="stylesheet" href="/css/all.css?id=1358f72d4f09b6629328c29d336d4540">

...instead of this:

<!-- Right URL -->
<link rel="stylesheet" href="/assets/css/all.css?id=1358f72d4f09b6629328c29d336d4540">

My overall goal here is to get output like that last code block... root-relative URLs to the assets, without the domain being specified. This bug report was just one hiccup on my route to that goal.

from craft-twigpack.

khalwat avatar khalwat commented on August 25, 2024

Please clear your caches, if you had it working before, probably it's something cache related.

from craft-twigpack.

proimage avatar proimage commented on August 25, 2024

Ok, so a co-worker of mine tackled this last night, and he has access to more cache-clearing powers than I do (I only have Craft's stuff; he can access Redis, Cloudflare, etc). Somehow, he solved this ("Somehow, Palpatine returned." 🤮). Wish I could say exactly what the problem was, but I guess we can just close this out. Sorry, man!

from craft-twigpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.