Giter Site home page Giter Site logo

Comments (15)

markcameron avatar markcameron commented on July 24, 2024

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.

hojabbr avatar hojabbr commented on July 24, 2024

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.

hojabbr avatar hojabbr commented on July 24, 2024

I should also mention the path is correct and has been tested many times before using minify.

from minify.

hojabbr avatar hojabbr commented on July 24, 2024

I have also emptied the ignore environments:

    'ignore_environments' => array(
    ),

from minify.

markcameron avatar markcameron commented on July 24, 2024

What's the path to the blue.css relative to the laravel root?

from minify.

markcameron avatar markcameron commented on July 24, 2024

Can you also post the code where you are doing the return view('.....') ?

from minify.

hojabbr avatar hojabbr commented on July 24, 2024
return Theme::view('frontend/index-header-fix');

from minify.

markcameron avatar markcameron commented on July 24, 2024

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.

hojabbr avatar hojabbr commented on July 24, 2024

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.

markcameron avatar markcameron commented on July 24, 2024

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.

hojabbr avatar hojabbr commented on July 24, 2024

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.

markcameron avatar markcameron commented on July 24, 2024

Hmm interesting... Wonder why it is doing that...

from minify.

markcameron avatar markcameron commented on July 24, 2024

Could be a namespace issue... tried this?

{!! \Minify::stylesheet('/themes/bootstrap/assets/frontend/layout/css/themes/blue.css') !!}

with the \ before Minify?

from minify.

hojabbr avatar hojabbr commented on July 24, 2024

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.

markcameron avatar markcameron commented on July 24, 2024

No problem, glad you got it working!

from minify.

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.