Comments (15)
Is your call to {!! Minify::stylesheet('/css/main.css') !!}
inside a view that your are setting to a variable rather then outputting directly? Try outputting it directly and you'll see the real error, this could just be that one of the CSS files does not have the correct path, which throws an exception, which makes the view break.
from minify.
This is in a blade file (header.blade.php):
<link href="/themes/bootstrap/assets/frontend/layout/css/themes/blue.css" rel="stylesheet" id="style-color">
However when I turn it into:
{!! Minify::stylesheet('/themes/bootstrap/assets/frontend/layout/css/themes/blue.css') !!}
I get the mentioned error.
from minify.
I should also mention the path is correct and has been tested many times before using minify.
from minify.
I have also emptied the ignore environments:
'ignore_environments' => array(
),
from minify.
What's the path to the blue.css relative to the laravel root?
from minify.
Can you also post the code where you are doing the return view('.....')
?
from minify.
return Theme::view('frontend/index-header-fix');
from minify.
Not familiar with a Theme
Facade, is it possible to write it as
return view('frontend/index-header-fix');
Just to test it so that it throws the real exception, rather then the exception that the view threw an exception?
from minify.
Guess what you asked made me realize the problem. The theme package I'm using (caffeinated/themes) uses the public folder as it's view folder for themes, while your package is looking for them in the resources folder. So this is why the exception is being thrown. Is there a way to overwrite the "resouces" folder to "public" folder without changing the core files in your package, for example adding a parameter to the config file?
from minify.
Hmmm, caffeinated/themes uses the public folder for views? That shouldn't have an effect on the way the package works... As long as the CSS files are in the public
folder, it should find them, no matter where the view it is called from is stored.
from minify.
As you requested I used plain old "return view" and seems there is nothing wrong with the package:
<script src="/asset_builds/js/builds/d063a6361d72a3d99c6bfe3a3ebd4b781429738218.js"></script>
So the problem must be the theme package (caffeinated/themes).
from minify.
Hmm interesting... Wonder why it is doing that...
from minify.
Could be a namespace issue... tried this?
{!! \Minify::stylesheet('/themes/bootstrap/assets/frontend/layout/css/themes/blue.css') !!}
with the \
before Minify?
from minify.
I found out why when I managed to make it work on a simple return view.
Because of the theme package, somehow the error shown is not correct one. While it should have been a "builds folder doesn't exist" error, for me to immediately identify that the builds folder for the assets is not where it should be (and that it doesn't have write permission) I was confused with another error. Anyway now with everything in their correct place and write permissions it's playing well with the Theme package.
Thanks for the hints and the help :)
from minify.
No problem, glad you got it working!
from minify.
Related Issues (20)
- What exactly are "custom attributes"? HOT 7
- Broken Minified Icons HOT 1
- Static syntax in blade examples HOT 1
- Inline javascript/css HOT 1
- [Question] What about multiple build paths? HOT 1
- How does it work ?
- Disk and name destination HOT 1
- Paths not working when in sub-directory HOT 1
- Css minify ' error
- Is there anyway to combine the files into one css file? HOT 1
- Minify type?
- CSS camelCase issue
- How can i use in php view HOT 1
- onlyUrl and withFullUrl should be resetted to default HOT 1
- not minifying files js and css HOT 4
- Breaking base64 images in CSS HOT 2
- minify css removes properties with var() HOT 2
- devfactory/minify for Laravel 8.2
- PHP 8 HOT 2
- Error in the http Check
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 minify.