Error reading data from JS file

Jun 3, 2009 at 4:45 PM

Hello,

    I'm trying to use the YIUCompression DLL in MSbuild but I keep on getting the following error when i run the MSBuild:

 

OUTPUT:

Target Build:
    Starting Css/Javascript compression...


    # Found one or more JavaScript file arguments. Now parsing ...
        ** Obfuscate Javascript: Yep!
        ** Preserve semi colons: Yep!
        ** Disable optimizations: Hell No!
        ** Line break position: None
        ** Thread Culture: Not defined
    # 1 JavaScript file requested.
        => C:\JSMinify\YIUCompressor\Test\disableButton.js    C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Failed to read
 in the data for the path/file [C:\JSMinify\YIUCompressor\Test\disableButton.js]. The most common cause for this is because the path is incorrect or the file na
me is incorrect ... so please check your path and file names. Until you fix this up, I can't continue ... sowwy.
    C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Value cannot be null.
    C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Parameter name: value
        Finished compressing all 1 file.
    Total original JavaScript file size: 405. After compression: 0. Compressed down to 0% of original size.
    Compressed content saved to file [C:\JSMinify\YIUCompressor\Test\disableButton.js].

    Finished Css/Javascript compression.
    Total time to execute task: 00:00:00.0312510
Done building target "Build" in project "Millena-I.Build.proj".

Done building project "Millena-I.Build.proj".

Build succeeded.
C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Failed to read inthe data for the path/file [C:\JSMinify\YIUCompressor\Test\disableButton.js]. Th
e most common cause for this is because the path is incorrect or the file name is incorrect ... so please check your path and file names. Until you fix this up,
 I can't continue ... sowwy.C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Value cannot be null.
C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Parameter name: value

 

Following is my build script:

 

<Project DefaultTargets="Build"
         xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<UsingTask TaskName="CompressorTask" AssemblyFile="C:\DLL\Yahoo.Yui.Compressor.dll" />

  <Target Name="Build">
    <!-- Create the list of files: you can create an explicit semi-colon delimited list or use wildcards as below -->
    <CreateItem Include="C:\JSMinify\YIUCompressor\Test\**\*.js">
      <Output TaskParameter="Include" ItemName="JavaScriptFiles" />
    </CreateItem> 

    <!-- Execute CompressorTask for each file in the list -->
    <CompressorTask
       Condition="'%(JavaScriptFiles.Identity)' != ''"
       JavaScriptFiles="%(JavaScriptFiles.Identity)"
       ObfuscateJavaScript="FoSho"
       PreserveAllSemicolons="Yeah"
       DisableOptimizations="Nope"
       EncodingType="Default"
       DeleteJavaScriptFiles="true"
       JavaScriptOutputFile="%(JavaScriptFiles.Identity)"
       LoggingType="ALittleBit" />
  </Target>
</Project>

 

 

I have given full rights ot the folder and the file (removed Read-only).The surprising part is that when the build fails my file is completely blank !

 

 

 

Jun 3, 2009 at 7:40 PM

I found out that the following line of code in the JS file breaks the build, if I remove it from the JS file it works fine :

 

// http://docs.jquery.com/Plugins/Validation/Methods/url
        url: function(value, element) {
            // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
            return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
        },

 

 

any ideas?

Coordinator
Jun 4, 2009 at 12:43 AM
Edited Jun 4, 2009 at 12:43 AM

Hi murtazamm - thanks for giving the project a go.

Firstly, have you used the dll's from the DOWNLOADS section OR did you grab the latest code, compile it yourself and then used those compiled dll's?

Secondly, could u post a link to the full source file?

Jun 8, 2009 at 8:57 PM

Hi,

   I'm using the DLL from Downloads (I did not get the source to compile)

Here is the link to the files:

http://www.2shared.com/file/6189136/d904132/YIUCompressor.html

Thanks !

Jun 27, 2009 at 9:56 PM

I too am getting the error:

***\www_deploy.wdproj(145,9): error : Failed to read in the data for the path/file [.\TempBuildDir\js\jquery-1.3.min.js]. The most common cause for this is because the path is incorrect or the file name is incorrect ... so please check your path and file names. Until you fix this up, I can't continue ... sowwy.
***\www_deploy.wdproj(145,9): error : Value cannot be null.

I've checked during the build and the file is (was) there, I've tried by specifying each path and by using *.js as well.

Interestingly, the same code for the .css files works just fine?

Tim

Jul 1, 2009 at 7:34 AM

Just to let you know that I tested the latest source commit (22605) and it appears to have fixed this issue, I'm guessing it relates to an illegal char (or similar) as it includes jQuery.

Tim

Coordinator
Jul 1, 2009 at 7:38 AM

Good stuff :) someday i'll put the latest source code compiled into the releases tab :P