1.12.x build now gives "Parse error. '}' expected" for .js with shebang

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

1.12.x build now gives "Parse error. '}' expected" for .js with shebang

neekfenwick
Hi guys,

We've been using 1.10.x for a long time and have a working build
system.  I just checked out 1.12.1 of dojo, dojox, dijit, util and ran a
build.  It's failing with errors that the 1.10.x build did not, I
presume this is because the Closure Compiler was updated in either 1.11
or 1.12. Our build profile specifies to use the Closure Compiler:

var profile = {
     action: "release",
     optimize: "closure",
     layerOptimize: "closure",
     cssOptimize: "comments",


The build ends with:

=====

starting cleaning up...
waiting for the optimizer runner to finish...
error(352) Optimizer reported errors; consult build report for details.
starting reporting...
Report written to /run/shm/winmob_build/build-report.txt
Process finished normally.
     errors: 26
     warnings: 1029
     build time: 60.155 seconds
=====

I get many instances of this kind of output in build-output.txt:

=====

/run/shm/build/node_modules/phonegap-build-api/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js:
run.js.uncompressed.js:2: ERROR - Parse error. '}' expected
#!/usr/bin/env node
^

1 error(s), 0 warning(s)
=====

Basically every .js file with a shebang line errors.  Obviously the
shebang line is not valid Javascript and so the file fails a basic
compile.  I've Googled a few different ways and am not finding any
reference to this error.

The 1.12 release notes http://livedocs.dojotoolkit.org/releasenotes/1.12 
say "Updated Closure Compiler to v20160911 to support ES6 grammar" and
the Closure Compiler project has a commit was back before v20140625 that
looks like it adds shebang support -
https://github.com/google/closure-compiler/commit/74b71e573b524ce61b86ced6ad2d27669146b8fa

Is this common, and how do you run a Dojo build to get around this?  
Pass a parameter to Closure Compiler via optimizeOptions to instruct it
to ignore shebang lines?  Somehow exclude the offending files from the
compiler's workload?

Thanks

Nick

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: 1.12.x build now gives "Parse error. '}' expected" for .js with shebang

dylanks
Hi Nick,

The short answer is I don't know, as I don't think Dojo has any files
with a # in their path, so we didn't run into this in our tests.

I've opened a regression bug at
https://bugs.dojotoolkit.org/ticket/18957 to see if we can track this
down for 1.12.2.

Regards,
-Dylan

on 1/17/17, 00:29 (GMT-07:00) Nick Fenwick said the following:

> Hi guys,
>
> We've been using 1.10.x for a long time and have a working build
> system.  I just checked out 1.12.1 of dojo, dojox, dijit, util and ran a
> build.  It's failing with errors that the 1.10.x build did not, I
> presume this is because the Closure Compiler was updated in either 1.11
> or 1.12. Our build profile specifies to use the Closure Compiler:
>
> var profile = {
>      action: "release",
>      optimize: "closure",
>      layerOptimize: "closure",
>      cssOptimize: "comments",
>
>
> The build ends with:
>
> =====
>
> starting cleaning up...
> waiting for the optimizer runner to finish...
> error(352) Optimizer reported errors; consult build report for details.
> starting reporting...
> Report written to /run/shm/winmob_build/build-report.txt
> Process finished normally.
>      errors: 26
>      warnings: 1029
>      build time: 60.155 seconds
> =====
>
> I get many instances of this kind of output in build-output.txt:
>
> =====
>
> /run/shm/build/node_modules/phonegap-build-api/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js:
> run.js.uncompressed.js:2: ERROR - Parse error. '}' expected
> #!/usr/bin/env node
> ^
>
> 1 error(s), 0 warning(s)
> =====
>
> Basically every .js file with a shebang line errors.  Obviously the
> shebang line is not valid Javascript and so the file fails a basic
> compile.  I've Googled a few different ways and am not finding any
> reference to this error.
>
> The 1.12 release notes http://livedocs.dojotoolkit.org/releasenotes/1.12 
> say "Updated Closure Compiler to v20160911 to support ES6 grammar" and
> the Closure Compiler project has a commit was back before v20140625 that
> looks like it adds shebang support -
> https://github.com/google/closure-compiler/commit/74b71e573b524ce61b86ced6ad2d27669146b8fa
>
> Is this common, and how do you run a Dojo build to get around this?  
> Pass a parameter to Closure Compiler via optimizeOptions to instruct it
> to ignore shebang lines?  Somehow exclude the offending files from the
> compiler's workload?
>
> Thanks
>
> Nick
>
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/
Reply | Threaded
Open this post in threaded view
|

Re: 1.12.x build now gives "Parse error. '}' expected" for .js with shebang

neekfenwick
Thanks Dylan!  I had a moment of clarity, as one often does just after
posting on the Internet, and realised that all of the problematic files
are actually not part of the web app.  They are all either pre-build
prep scripts that we have written, or node_modules content from third
party libraries used by analytical and test scripts.  All these scripts
are hanging around in our web app src tree, because we never had a good
reason to put them anywhere else.

I wiped out all the node_modules folders, and removed the shebangs from
the few executable .js files of ours, and the build then completes just
fine.

I'll rearrange our src tree so non-web content is not in the modules the
Dojo build pulls in, and the problem will have gone away.  It would
still be nice to know how to control this but in our project we do not
actually need these shebang'd scripts in our minified Dojo build.  
Perhaps some server side projects would, so the ticket may be of use.

The good news is that moving to 1.12.1 has fixed a nasty ScrollablePane
problem we had in our mobile app, where scrolling jumped a short
distance and stopped, requiring many swipes to get anywhere.  Glad I'm
not going to have to investigate the touch scroll stuff.. and hoping
nothing else has broken.. time for some regression testing!

Cheers
Nick

On 17/01/17 19:07, Dylan Schiemann wrote:

> Hi Nick,
>
> The short answer is I don't know, as I don't think Dojo has any files
> with a # in their path, so we didn't run into this in our tests.
>
> I've opened a regression bug at
> https://bugs.dojotoolkit.org/ticket/18957 to see if we can track this
> down for 1.12.2.
>
> Regards,
> -Dylan
>
> on 1/17/17, 00:29 (GMT-07:00) Nick Fenwick said the following:
>> Hi guys,
>>
>> We've been using 1.10.x for a long time and have a working build
>> system.  I just checked out 1.12.1 of dojo, dojox, dijit, util and ran a
>> build.  It's failing with errors that the 1.10.x build did not, I
>> presume this is because the Closure Compiler was updated in either 1.11
>> or 1.12. Our build profile specifies to use the Closure Compiler:
>>
>> var profile = {
>>       action: "release",
>>       optimize: "closure",
>>       layerOptimize: "closure",
>>       cssOptimize: "comments",
>>
>>
>> The build ends with:
>>
>> =====
>>
>> starting cleaning up...
>> waiting for the optimizer runner to finish...
>> error(352) Optimizer reported errors; consult build report for details.
>> starting reporting...
>> Report written to /run/shm/winmob_build/build-report.txt
>> Process finished normally.
>>       errors: 26
>>       warnings: 1029
>>       build time: 60.155 seconds
>> =====
>>
>> I get many instances of this kind of output in build-output.txt:
>>
>> =====
>>
>> /run/shm/build/node_modules/phonegap-build-api/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js:
>> run.js.uncompressed.js:2: ERROR - Parse error. '}' expected
>> #!/usr/bin/env node
>> ^
>>
>> 1 error(s), 0 warning(s)
>> =====
>>
>> Basically every .js file with a shebang line errors.  Obviously the
>> shebang line is not valid Javascript and so the file fails a basic
>> compile.  I've Googled a few different ways and am not finding any
>> reference to this error.
>>
>> The 1.12 release notes http://livedocs.dojotoolkit.org/releasenotes/1.12
>> say "Updated Closure Compiler to v20160911 to support ES6 grammar" and
>> the Closure Compiler project has a commit was back before v20140625 that
>> looks like it adds shebang support -
>> https://github.com/google/closure-compiler/commit/74b71e573b524ce61b86ced6ad2d27669146b8fa
>>
>> Is this common, and how do you run a Dojo build to get around this?
>> Pass a parameter to Closure Compiler via optimizeOptions to instruct it
>> to ignore shebang lines?  Somehow exclude the offending files from the
>> compiler's workload?
>>
>> Thanks
>>
>> Nick
>>

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: 1.12.x build now gives "Parse error. '}' expected" for .js with shebang

dylanks
Thanks Nick,

Based on that I'll leave it open but reduce its severity, as those types
of files should probably be excluded from a build anyway.

Glad to hear that 1.12.1 has fixed your issue! And yes, please let us
know if you see any other regressions that need to be fixed.

Regards,
-Dylan

on 1/17/17, 05:28 (GMT-07:00) Nick Fenwick said the following:

> Thanks Dylan!  I had a moment of clarity, as one often does just after
> posting on the Internet, and realised that all of the problematic files
> are actually not part of the web app.  They are all either pre-build
> prep scripts that we have written, or node_modules content from third
> party libraries used by analytical and test scripts.  All these scripts
> are hanging around in our web app src tree, because we never had a good
> reason to put them anywhere else.
>
> I wiped out all the node_modules folders, and removed the shebangs from
> the few executable .js files of ours, and the build then completes just
> fine.
>
> I'll rearrange our src tree so non-web content is not in the modules the
> Dojo build pulls in, and the problem will have gone away.  It would
> still be nice to know how to control this but in our project we do not
> actually need these shebang'd scripts in our minified Dojo build.  
> Perhaps some server side projects would, so the ticket may be of use.
>
> The good news is that moving to 1.12.1 has fixed a nasty ScrollablePane
> problem we had in our mobile app, where scrolling jumped a short
> distance and stopped, requiring many swipes to get anywhere.  Glad I'm
> not going to have to investigate the touch scroll stuff.. and hoping
> nothing else has broken.. time for some regression testing!
>
> Cheers
> Nick
>
> On 17/01/17 19:07, Dylan Schiemann wrote:
>> Hi Nick,
>>
>> The short answer is I don't know, as I don't think Dojo has any files
>> with a # in their path, so we didn't run into this in our tests.
>>
>> I've opened a regression bug at
>> https://bugs.dojotoolkit.org/ticket/18957 to see if we can track this
>> down for 1.12.2.
>>
>> Regards,
>> -Dylan
>>
>> on 1/17/17, 00:29 (GMT-07:00) Nick Fenwick said the following:
>>> Hi guys,
>>>
>>> We've been using 1.10.x for a long time and have a working build
>>> system.  I just checked out 1.12.1 of dojo, dojox, dijit, util and ran a
>>> build.  It's failing with errors that the 1.10.x build did not, I
>>> presume this is because the Closure Compiler was updated in either 1.11
>>> or 1.12. Our build profile specifies to use the Closure Compiler:
>>>
>>> var profile = {
>>>       action: "release",
>>>       optimize: "closure",
>>>       layerOptimize: "closure",
>>>       cssOptimize: "comments",
>>>
>>>
>>> The build ends with:
>>>
>>> =====
>>>
>>> starting cleaning up...
>>> waiting for the optimizer runner to finish...
>>> error(352) Optimizer reported errors; consult build report for details.
>>> starting reporting...
>>> Report written to /run/shm/winmob_build/build-report.txt
>>> Process finished normally.
>>>       errors: 26
>>>       warnings: 1029
>>>       build time: 60.155 seconds
>>> =====
>>>
>>> I get many instances of this kind of output in build-output.txt:
>>>
>>> =====
>>>
>>> /run/shm/build/node_modules/phonegap-build-api/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js:
>>> run.js.uncompressed.js:2: ERROR - Parse error. '}' expected
>>> #!/usr/bin/env node
>>> ^
>>>
>>> 1 error(s), 0 warning(s)
>>> =====
>>>
>>> Basically every .js file with a shebang line errors.  Obviously the
>>> shebang line is not valid Javascript and so the file fails a basic
>>> compile.  I've Googled a few different ways and am not finding any
>>> reference to this error.
>>>
>>> The 1.12 release notes http://livedocs.dojotoolkit.org/releasenotes/1.12
>>> say "Updated Closure Compiler to v20160911 to support ES6 grammar" and
>>> the Closure Compiler project has a commit was back before v20140625 that
>>> looks like it adds shebang support -
>>> https://github.com/google/closure-compiler/commit/74b71e573b524ce61b86ced6ad2d27669146b8fa
>>>
>>> Is this common, and how do you run a Dojo build to get around this?
>>> Pass a parameter to Closure Compiler via optimizeOptions to instruct it
>>> to ignore shebang lines?  Somehow exclude the offending files from the
>>> compiler's workload?
>>>
>>> Thanks
>>>
>>> Nick
>>>
>
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/