sprockets-rails icon indicating copy to clipboard operation
sprockets-rails copied to clipboard

Concatenating the scripts in development produces string js code when extra newline breaks present

Open JohnMerlino2 opened this issue 6 years ago • 0 comments

I can't reproduce this error. I don't know how to reproduce this error. I am not even sure what the error is. I just know it was an error. I was using Assets Pipeline in development, and I started to get this javascript error about it calling one of my functions but passing in invalid arguments. I traced it to this line of code:

(function() {

}).call(this);

Sprockets added this between two concatenated scripts. When I removed the trailing white space in the script before, suddenly the error went away. All I did was remove white space at the bottom of the script.

Like I said, I have no clue how to reproduce this error. All I know is it happened, and I don't know why white space at bottom of one script would generate such code.

JohnMerlino2 avatar May 22 '19 18:05 JohnMerlino2