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

undefined method `bytesize' for nil:NilClass #12

Closed
linjunpop opened this issue Mar 20, 2013 · 9 comments
Closed

undefined method `bytesize' for nil:NilClass #12

linjunpop opened this issue Mar 20, 2013 · 9 comments

Comments

@linjunpop
Copy link

In my app.

# app/assets/stylesheets/application_split2.css.split2
/* = include application.css */
# app/views/layouts/application.html.slim
= split_stylesheet_link_tag "application"

I got undefined method 'bytesize' for nil:NilClass when I start the app, same error while I try to compile assets.

Which happens in https://github.com/sstephenson/sprockets/blob/v2.2.2/lib/sprockets/processed_asset.rb#L12

The @source is nil. While pathname is "#<Pathname:/Users/linjunpop/Code/Pracstrat/fo-web/app/assets/stylesheets/application_split2.css.split2>"

@jhilden
Copy link
Contributor

jhilden commented Mar 20, 2013

Afaik this means that the stylesheet is empty when it's processed by Sprockets. This could either mean that application.css is empty (which I don't believe), or that the = include isn't working properly. However, I'm not sure what the problem could be here. Have you maybe tried putting parenthesis '..' around the application.css?

Let me know if that helps you to resolve the issue. Otherwise it would be good to have simple app that reproduces the problem.

@linjunpop
Copy link
Author

@jhilden If I add some content to application.css, it works.

This works:

/*
 * = require ...
 *
 */

.foo { }

This fails:

/*
 * = require ...
 *
 */

Also, If I add something to application_split2.css.split2, it can successfully compile too.

@jhilden
Copy link
Contributor

jhilden commented Mar 21, 2013

I was able to reproduce the bug here: 52ff7f9

I guess it's an issue with Sprocket's include directive. But I'm unsure on how to go about fixing it right now. Have to dig a little deeper. Help is appreciated.

@cj
Copy link
Contributor

cj commented Jul 29, 2013

I'm having this same issue using scss files contents looks like:

@import "flatty/flatty";
@import "flatty/mdocs-theme";
@import "custom";
@import "pt/tags";
@import "jQuery-File-Upload/jquery.fileupload-ui.css";

@cj
Copy link
Contributor

cj commented Jul 29, 2013

I also get no implicit conversion of nil into String (in /home/cj/Dropbox/mdocs/master/app/assets/stylesheets/application_split2.css.scss.split2)

@cj
Copy link
Contributor

cj commented Jul 29, 2013

line 13 of app/helpers/css_splitter/application_helper.rb is what is triggering that error ^

@Burkazoid
Copy link

Also experiencing this issue. Resolved by adding an empty class to the bottom of application.css as advised by @linjunpop; however, a better fix would be much appreciated if anyone knows of one.

Edit: Now it compiles ok but results in issue #21.

@jhilden
Copy link
Contributor

jhilden commented May 6, 2014

@linjunpop @jamesburke-examtime @cj can you please test if you still have issues with the current master?

@jhilden
Copy link
Contributor

jhilden commented Sep 4, 2014

closing this due to inactivity. reopen if issue persists.

@jhilden jhilden closed this as completed Sep 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants