Comments (8)
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.
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.
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.
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.
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.
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.
Please clear your caches, if you had it working before, probably it's something cache related.
from craft-twigpack.
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)
- [FR] CSP nonce support HOT 7
- webpack-dev-server/HMR not working in Nitro setup HOT 3
- includeCriticalCssTags() returns empty HOT 1
- Hashes wrong (cache?) in production - ideas why? HOT 3
- Does update 1.2.4 removes the need for the styles.js workaround? HOT 1
- support chunks-webpack-plugin HOT 1
- missing "simplified version" of the config HOT 1
- Let me define a fallback CSS file for criticalcss HOT 1
- "modern" script not loaded when async is missing HOT 2
- Cannot load criticalcss if router file is used instead of a the specific template path in the CMS HOT 1
- Issues with twigpack cache on Heroku HOT 4
- Request to mix-manifest.json is malformed HOT 2
- Aliases like @webroot not working HOT 5
- ViteJS Support HOT 9
- Rendering templates with multiple getModuleUri calls is extremely slow after release v1.2.12 HOT 1
- ErrorException thrown when open_basedir restriction in effect HOT 7
- getModuleUri giving the correct URL to CSS but includeCssModule doesn't include the CSS on the page HOT 2
- 4.0.0 release HOT 4
- Craft 5 & Craft 4 out of beta HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-twigpack.