jnadaud / grav-plugin-gitter

Gitter plugin for Grav CMS
MIT License
0 stars 1 forks source link

Gitter borks the site when JS minification is active in Grav #2

Open danielpetre opened 8 years ago

danielpetre commented 8 years ago

Hello, if i enable the JS minification in Grav then the Gitter plugin borks the website with many errors like:

Twig_ErrorRuntime An exception has been thrown during the rendering of a template ("JSMin: Unterminated String at byte 352572: " �(����I2��� �K� � �Z�'���B�� P AY��33Yi�M����޵ou���;�Ӿ�^z��P�� �uB�T, 1cL�,� D<�8b ��� r ~w �E�=��.� �Ɲ|ֈ� w�P �~� �����Er; B հ���$�N�U�֦7���$p dP�)�k�*Ū�3��l� �� �«�;V���nB�.n� �65IѵC�wf ") in "partials/base.html.twig" at line 38.

jnadaud commented 8 years ago

Hi,

Can you please tell me more ? Grav version ? Any other plugin ?

Kindly regards

danielpetre commented 8 years ago

Hey, using latest stable Grav 1.0.10 with lots of official plugins:

Admin Panel v1.0.10
Breadcrumbs v1.4.0
Diagrams v1.0.1
Editor Buttons v1.0.0
Email v2.4.0
Error v1.4.1
Featherlight v1.3.1
Feed v1.4.1
Form v1.2.2
Gitter v1.0.0
LangSwitcher v1.2.1
Login v1.3.1
Markdown Color v1.0.1
Markdown Notices v1.0.0
Pagination v1.3.2
Problems v1.4.3
Reading Time v1.0.7
Related Pages v1.1.2
Shortcode Core v2.2.1
Shortcode UI v2.0.0
Sitemap v1.6.1
SnappyGrav v1.1.1
Taxonomy List v1.2.7
YouTube v2.0.2

Gitter plugin breaks the home page only if i enable JS pipeline, i see it is cool if i let JS minification on but as soon as i activate JS pipeline..

Here, enabling js pipeline for you to see the errors -> https://tmp.ro

Twig_Error_Runtime An exception has been thrown during the rendering of a template ("JSMin: Unterminated String at byte 107467: " �(����I2��� �K� � �Z�'���B�� P AY��33Yi�M����޵ou���;�Ӿ�^z��P�� �uB�T, 1cL�,� D<�8b ��� r ~w �E�=��.� _�Ɲ|ֈ� w�P �~� �����Er; B հ���$�N�U�֦7���$p dP�)�k�*Ū�3��l� �� �«�;V���nB�.n� �65IѵC�wf ") in "partials/base.html.twig" at line 38.

danielpetre commented 8 years ago

tried to replace:

->addJs('https://sidecar.gitter.im/dist/sidecar.v1.js', array('loading' => 'defer'))

with:

->addJs('https://sidecar.gitter.im/dist/sidecar.v1.js', array('loading' => 'defer', 'pipeline' => 'false'))

with no success..

flaviocopes commented 8 years ago

I already seen this issue here https://github.com/getgrav/grav/issues/231, was a problem in the JS file being minified.

flaviocopes commented 8 years ago

Forcing it to be excluded from the pipeline should work in Grav 1.1