Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to assign arg @list: line: 121 during php artisan basset:build #223

Closed
hanneskaljuste opened this issue Oct 14, 2013 · 42 comments
Closed

Comments

@hanneskaljuste
Copy link

Got that error, did everything according to instructions.

@andrew13
Copy link
Collaborator

What version of php are you on? What type of OS? Also seems to be a basset issue, not a starter site issue.

@hanneskaljuste
Copy link
Author

Thanks for quick reply.
I tried it on my Linux (php 5.4.9) and Mac (php 5.4.19) and got both same result.
I'm not very at home with less, but i started digging and got compile success when i commented out some twbs .less files. So yes, seems it's not starter site bug, but i would really like to get it working. Will research some more.
Thanks for the great project!

@kevincompton
Copy link

I'm getting this same exact error so it's definitely a bug, I'll check on basset for a fix in the meantime the documentation here could include a workaround.

@andrew13
Copy link
Collaborator

I do believe there's an issue here, not sure at the moment what it is. I don't have time to dig for it at the moment, but if you figure out a proper workaround let me know and I'll include it in the docs.

@kevincompton
Copy link

working on it, it's pretty confusing but clearly a basset issue - or the use of basset in this app

@kevincompton
Copy link

jasonlewis/basset#213

@madil4
Copy link

madil4 commented Oct 14, 2013

same issue with me too..on windows with wamp 2.4 !!

@kevincompton
Copy link

is there a way to bypass this functionality? It's completely halted any development using this starter site. Can't even get views to load

@hanneskaljuste
Copy link
Author

OK i got it: http://raffworks.com/laravel-4-assets-basset-less-part-1/ and the line is : 'Less' => array('LessphpFilter', function($filter). You need to set Basset to use lessphp. But now i have another error: Call to undefined method Illuminate\Support\Facades\Auth::check(), but i think i can manage with that.
Good luck guys!

@hanneskaljuste
Copy link
Author

Well, actually, not getting error anymore, but :
Starting development build...
Gathering all collections to build...

[application] Stylesheets build was not required for collection.
[application] Javascripts build was not required for collection.

Style and JS not compiling. Any idea anyone?

@kevincompton
Copy link

For me the lessphp filter was already in place. What I did different was publish the settings doing: php artisan config:publish jasonlewis/basset

Now I can run build, however using: php artisan basset:build

I get the following:

[application] Stylesheets build was not required for collection.
[application] Javascripts build was not required for collection.

So my project has no style or js.

@madil4
Copy link

madil4 commented Oct 14, 2013

the css & js will not load because the basset config file changed from the starter that came with.........will dig further & see what we can get

@hanneskaljuste
Copy link
Author

Yes, also there. Change in config 'collection' => 'application' to 'public' and/or 'admin' and then basset:build public / basset:build admin. Then you'll get it to compile. But jquery is missing, so js is not working, but managed to get styles. Also build path to assets/compiled.

@kevincompton
Copy link

i don't follow, still no assets

@kevincompton
Copy link

is this all necessary? I'd be fine with hardcoding the assets and compiling less files myself. Where can I grab them and how could I gut this feature?

@hanneskaljuste
Copy link
Author

I believe less files are a part of twbs (under vendors). Take a look at /public/css/less/master.less. I guess you could manually compile from that.

@kevincompton
Copy link

hmm ya would be nice to get this working.

I tried changing the collection name in config to public and do the build and I get the same result:

[public] Stylesheets build was not required for collection.
[public] Javascripts build was not required for collection.

@hanneskaljuste
Copy link
Author

Here is my config, it should work:

array( 'public' => function($collection) { // Switch to the stylesheets directory and require the "less" and "sass" directories. // These directories both have a filter applied to them so that the built // collection will contain valid CSS. $directory = $collection->directory('assets/css', function($collection) { $collection->requireDirectory('less')->apply('Less'); $collection->requireDirectory('sass')->apply('Sass'); $collection->requireDirectory(); }); $directory->apply('CssMin'); $directory->apply('UriRewriteFilter'); // Switch to the javascripts directory and require the "coffeescript" directory. As // with the above directories we'll apply the CoffeeScript filter to the directory // so the built collection contains valid JS. $directory = $collection->directory('assets/js', function($collection) { $collection->requireDirectory('coffeescripts')->apply('CoffeeScript'); $collection->requireDirectory(); }); $directory->apply('JsMin'); }, 'admin' => function($collection) { // Switch to the stylesheets directory and require the "less" and "sass" directories. // These directories both have a filter applied to them so that the built // collection will contain valid CSS. $directory = $collection->directory('assets/css', function($collection) { $collection->requireDirectory('less')->apply('Less'); $collection->requireDirectory('sass')->apply('Sass'); $collection->requireDirectory(); }); $directory->apply('CssMin'); $directory->apply('UriRewriteFilter'); // Switch to the javascripts directory and require the "coffeescript" directory. As // with the above directories we'll apply the CoffeeScript filter to the directory // so the built collection contains valid JS. $directory = $collection->directory('assets/js', function($collection) { $collection->requireDirectory('coffeescripts')->apply('CoffeeScript'); $collection->requireDirectory(); }); $directory->apply('JsMin'); } ), /* |-------------------------------------------------------------------------- | Production Environment |-------------------------------------------------------------------------- | | Basset needs to know what your production environment is so that it can | respond with the correct assets. When in production Basset will attempt | to return any built collections. If a collection has not been built | Basset will dynamically route to each asset in the collection and apply | the filters. | | The last method can be very taxing so it's highly recommended that | collections are built when deploying to a production environment. | | You can supply an array of production environment names if you need to. | */ 'production' => array('production', 'prod'), /* |-------------------------------------------------------------------------- | Build Path |-------------------------------------------------------------------------- | | When assets are built with Artisan they will be stored within a directory | relative to the public directory. | | If the directory does not exist Basset will attempt to create it. | */ 'build_path' => 'assets/compiled', /* |-------------------------------------------------------------------------- | Debug |-------------------------------------------------------------------------- | | Enable debugging to have potential errors or problems encountered | during operation logged to a rotating file setup. | */ 'debug' => false, /* |-------------------------------------------------------------------------- | Node Paths |-------------------------------------------------------------------------- | | Many filters use Node to build assets. We recommend you install your | Node modules locally at the root of your application, however you can | specify additional paths to your modules. | */ 'node_paths' => array( base_path().'/node_modules' ), /* |-------------------------------------------------------------------------- | Gzip Built Collections |-------------------------------------------------------------------------- | | To get the most speed and compression out of Basset you can enable Gzip | for every collection that is built via the command line. This is applied | to both collection builds and development builds. | | You can use the --gzip switch for on-the-fly Gzipping of collections. | */ 'gzip' => false, /* |-------------------------------------------------------------------------- | Asset and Filter Aliases |-------------------------------------------------------------------------- | | You can define aliases for commonly used assets or filters. | An example of an asset alias: | | 'layout' => 'stylesheets/layout/master.css' | | Filter aliases are slightly different. You can define a simple alias | similar to an asset alias. | | 'YuiCss' => 'Yui\CssCompressorFilter' | | However if you want to pass in options to an aliased filter then define | the alias as a nested array. The key should be the filter and the value | should be a callback closure where you can set parameters for a filters | constructor, etc. | | 'YuiCss' => array('Yui\CssCompressorFilter', function($filter) | { | $filter->setArguments('path/to/jar'); | }) | | */ 'aliases' => array( 'assets' => array(), 'filters' => array( /* |-------------------------------------------------------------------------- | Less Filter Alias |-------------------------------------------------------------------------- | | Filter is applied only when asset has a ".less" extension and it will | attempt to find missing constructor arguments. | */ 'Less' => array('LessFilter', function($filter) { $filter->whenAssetIs('.*\.less')->findMissingConstructorArgs(); }), /* |-------------------------------------------------------------------------- | Sass Filter Alias |-------------------------------------------------------------------------- | | Filter is applied only when asset has a ".sass" or ".scss" extension and | it will attempt to find missing constructor arguments. | */ 'Sass' => array('Sass\ScssFilter', function($filter) { $filter->whenAssetIs('.*\.(sass|scss)')->findMissingConstructorArgs(); }), /* |-------------------------------------------------------------------------- | CoffeeScript Filter Alias |-------------------------------------------------------------------------- | | Filter is applied only when asset has a ".coffee" extension and it will | attempt to find missing constructor arguments. | */ 'CoffeeScript' => array('CoffeeScriptFilter', function($filter) { $filter->whenAssetIs('.*\.coffee')->findMissingConstructorArgs(); }), /* |-------------------------------------------------------------------------- | CssMin Filter Alias |-------------------------------------------------------------------------- | | Filter is applied only when within the production environment and when | the "CssMin" class exists. | */ 'CssMin' => array('CssMinFilter', function($filter) { $filter->whenAssetIsStylesheet()->whenProductionBuild()->whenClassExists('CssMin'); }), /* |-------------------------------------------------------------------------- | JsMin Filter Alias |-------------------------------------------------------------------------- | | Filter is applied only when within the production environment and when | the "JsMin" class exists. | */ 'JsMin' => array('JSMinFilter', function($filter) { $filter->whenAssetIsJavascript()->whenProductionBuild()->whenClassExists('JSMin'); }), /* |-------------------------------------------------------------------------- | UriRewrite Filter Alias |-------------------------------------------------------------------------- | | Filter gets a default argument of the path to the public directory. | */ 'UriRewriteFilter' => array('UriRewriteFilter', function($filter) { $filter->setArguments(public_path())->whenAssetIsStylesheet(); }) ) ) ``` );

@kevincompton
Copy link

bingo, must be something else that was different in mine somehow. Thanks!

@hanneskaljuste
Copy link
Author

But it still acts weird. Be sure to compile both.(admin and public). I still have not managed to get the navigation menu working. I think it's too late today, maybe tomorrow.

@kevincompton
Copy link

ya I'm where you are. Added Jquery to the head and it got me a bunch more errors. Loosing patience with this as a shortcut to starting from scratch. :-/

@kevincompton
Copy link

Uncaught TypeError: Cannot read property 'defaults' of undefined datatables-bootstrap-a5bbeb6d8cb198bb3f428df5496096ef.js:2

Uncaught TypeError: Cannot read property 'oApi' of undefined datatables.fnReloadAjax-a5bbeb6d8cb198bb3f428df5496096ef.js:14

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:8000/assets/img/glyphicons-halflings.png

@nzram
Copy link

nzram commented Oct 15, 2013

I temporarily replaced grid.less with latest grid.less downloaded from Bootstrap site, and got successful loading.

@DarkHero8
Copy link

no luck with this file https://raw.github.com/twbs/bootstrap/master/less/grid.less
put it in the vendor folder

@kevincompton
Copy link

Decided to move forward without this starter. It's a good project though
keep it up!

On Tuesday, October 15, 2013, DarkHero8 wrote:

no luck with this file
https://raw.github.com/twbs/bootstrap/master/less/grid.less
put it in the vendor folder


Reply to this email directly or view it on GitHubhttps://github.com//issues/223#issuecomment-26352338
.

Kevin Compton
http://Nufish.com/m: (310) 310-1756

@andrew13
Copy link
Collaborator

Sorry to hear that. Best of luck!

@jmmoody
Copy link

jmmoody commented Oct 15, 2013

I am having the same issue with the latest code also. When I modify the basset/config.php file per iiker's suggestion "Less' => array('LessphpFilter', function($filter). You need to set Basset to use lessphp." it does fix the basset generation issue but now it looks like there is no CSS formatting going on. Also for some reason it seems to be pulling in the tooltip.js file in the wrong order as I receive the error Uncaught Error: Popover requires tooltip.js on most pages. Looking at the page source the generated code looks like this

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/affix-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/alert-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/button-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/carousel-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/collapse-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/dropdown-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/modal-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/popover-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/scrollspy-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/tab-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/tooltip-60d7bbdd9f135c667da5295242a3046d.js"></script>
<script src="http://localhost:8000/assets/compiled/public/2eb2636917cce474452ddb771f62df17/transition-60d7bbdd9f135c667da5295242a3046d.js"></script>

As you can see the tooltip.js file is included after the popover.js file. I believe that tooltip.js needs to be include before the popover.js.

Looks like this is getting generated in alphabetical order which just seems wrong as you sometimes need some control on the order that these assets get generated in.

The Gruntfile.js file in twbs/bootstrap/ seems to have the javascript files in the correct order as per here

bootstrap: {
        src: [
          'js/transition.js',
          'js/alert.js',
          'js/button.js',
          'js/carousel.js',
          'js/collapse.js',
          'js/dropdown.js',
          'js/modal.js',
          'js/tooltip.js',
          'js/popover.js',
          'js/scrollspy.js',
          'js/tab.js',
          'js/affix.js'
        ],
        dest: 'dist/js/<%= pkg.name %>.js'

I have an earlier version of the starter site installed and it seems to work fine except for the tooltip.js issue. Looks like I downloaded that some time around 9/6/2013. I will do some comparison on the various config files to see if I can see if that is the issue. And I will also attempt to find out the various version of the software that I have installed in each system.

Let me know if anyone needs more information.

@nzram
Copy link

nzram commented Oct 15, 2013

I use grid.less Bootstrap Team put at http://getbootstrap.com/ (https://github.com/twbs/bootstrap/archive/v3.0.0.zip). The version included in the starter has mixins that caused this issue.

@raykwok
Copy link

raykwok commented Oct 16, 2013

Same issue for me

@Seb7
Copy link

Seb7 commented Oct 16, 2013

Same here: Failed to assign arg @list: line: 121
open: C:**_\htdocs*_\vendor\leafo\lessphp\lessc.inc.php

I'm on windows 7, PHP Version 5.4.7 .

It's unusable because of this.

Also the old issue still seems to be unresolved or at least it appear so.
#133

I am thankful for this starter but what use it is if it can't be used. I already had to use different starter for 3 projects and I would really like to use this one.I was hoping that months latter it would work nicely but no luck :(

It seems that basset is causing a lot of problems - is it possible to ditch it and replace it with something better? It looks like in both of cases it is a basset issue! Thanks.

@autoferrit
Copy link

I can confirm that the comment by @nzram worked. I pulled the zip from https://github.com/twbs/bootstrap/archive/v3.0.0.zip and replaced all the less files with the ones from the zip file, and everything worked.

@Seb7
Copy link

Seb7 commented Oct 16, 2013

@luckysmack I just tried it and you are right - this fixes this issue. Thanks @nzram .

Now #133 still remains, I'll see if any of offered solutions will work.

Edit, both issues are solved for me now:

Time out on windows (why is http: not used? Why does url start with just // ?):
#148 (comment)

Failed to assign arg @list: line: 121 during php artisan basset:build
#223 (comment)

@teodorsandu
Copy link

It works!!
I confirm @nzram and @luckysmack solution.
I replaced the content of
C:/wamp/www/Laravel-4-Bootstrap-Starter-Site-master/vendor/twbs/bootstrap/less
with
bootstrap-3.0.0.zip/bootstrap-3.0.0/less/
thank you

@ivicatadic
Copy link

I can confirm, even though I actually replaced entire twbs bootstrap with the 'official' one - all works just fine.

Cheers,
Ivica

@michaeldyrynda
Copy link

Yep, thanks @nzram - that worked a charm!

@andrew13
Copy link
Collaborator

So is the solution to just put twitter bootstrap in the project instead of using the composer version?

@ivicatadic
Copy link

IMHO, yup :)
On Oct 18, 2013 3:24 AM, "Andrew" [email protected] wrote:

So is the solution to just put twitter bootstrap in the project instead of
using the composer version?


Reply to this email directly or view it on GitHubhttps://github.com//issues/223#issuecomment-26566280
.

@jmmoody
Copy link

jmmoody commented Oct 19, 2013

Thanks @nzram - that fixes the basset compiling issue.. but still don't have any css formatting... not sure what that is about...

@jmmoody
Copy link

jmmoody commented Oct 19, 2013

Ok Figured out the CSS issue.. forgot to change back the less filter alias to LessphpFilter.. everything is now back to normal THANKS!!!!!

@nightowl77
Copy link

Got this same issue today. TWBS was updated to 3.0.1 four days ago.

A solution that worked for me was to change the version in composer to "3.0.0" instead of "3.0.*"

"require": {
        "laravel/framework": "4.0.*",
        "twbs/bootstrap":  "3.0.0",

@rhyslbw
Copy link

rhyslbw commented Nov 4, 2013

Can confirm the workaround provided by @nightowl77

Any progress on a fix?

@domtancredi
Copy link

Thanks for the fix! Same issue. andrew13

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

No branches or pull requests