Search code examples
meteoriron-routerblueimp

Meteor app doesn't work in production


I am trying to use blueimp image gallery in a meteor application. My image gallery works in development, however when I run it like this:

meteor --production

It does not work. It shows the iron-router splash screen. Similarly, if I deploy my app to meteor.com it does not work:

meteor deploy blueimpMeteor

see the site

However if I deploy my app in debug mode, it does work:

meteor deploy blueimpMeteorDebug --debug

see the debug site

What could be causing my meteor app to not work in production mode?

Source: https://github.com/icedTeaFresh/meteorBlueimpBroken


Solution

  • Thanks for providing the source. I tried a few things and found this to be the easiest:

    1. You are not supposed to include both the jquery and non-jquery versions of the plugin along with the minified and non-minified versions. I removed all of the scripts under client/compatibility/js except for jquery.blueimp-gallery.min.js.

    2. Remove the <script> tag from home.html. In meteor you generally want to initialize your plugins from within an onRendered callback, however neither is necessary in this case.

    3. As shown here you just need to add the data-gallery property to your links like so:

    <div id = "links">
      <a href="/1.JPG" title="1" data-gallery>
        <img src="/1.JPG" class="img-thumbnail" alt="1" width="100" height="100">
      </a>
      <a href="/1.JPG" title="1" data-gallery>
        <img src="/1.JPG" class="img-thumbnail" alt="1" width="100" height="100">
      </a>
    </div>
    

    After making those changes, it worked for me in both development and production mode.