Menu icon Foundation
CLI installed F6.1.1 doesn't update Panini changes in dist

Observed behavior:
With a fresh install of 6.1.1 done through the CLI and running 'foundation watch', changes I make to Panini elements from partials folder or anything from the layouts/default.html don't make it to the dist folder after initial watch is set.

I have a file in src/partials/nav.html and refer to it with {{> nav}} in src/pages/index.html.

The only way to get the updated Panini elements into the dist folder is to CMD-C and restart with 'foundation watch'. This builds out everything as expected. The crazy part is that I can make just ONE change to a panini element (e.g. nav.html) and have it build out to dist as expected (and automatically reload in the browser with the change), but only once.

The same type of behavior occurs when I try to modify simple html in layouts/default.html.

Expected behavior:
To be able to make a change to panini elements and have it build to the dist folder without having to stop the process.

Thanks!

Mac 10.8.5 | Chrome Version 47.0.2526.106 (64-bit) | node v0.12.0 | npm 2.5.1

paniniHandlebarscli

Observed behavior:
With a fresh install of 6.1.1 done through the CLI and running 'foundation watch', changes I make to Panini elements from partials folder or anything from the layouts/default.html don't make it to the dist folder after initial watch is set.

I have a file in src/partials/nav.html and refer to it with {{> nav}} in src/pages/index.html.

The only way to get the updated Panini elements into the dist folder is to CMD-C and restart with 'foundation watch'. This builds out everything as expected. The crazy part is that I can make just ONE change to a panini element (e.g. nav.html) and have it build out to dist as expected (and automatically reload in the browser with the change), but only once.

The same type of behavior occurs when I try to modify simple html in layouts/default.html.

Expected behavior:
To be able to make a change to panini elements and have it build to the dist folder without having to stop the process.

Thanks!

Mac 10.8.5 | Chrome Version 47.0.2526.106 (64-bit) | node v0.12.0 | npm 2.5.1

hector_sapien over 3 years ago

I'm having the same issue. I can do 1 or maybe 2 saves in a partial, the I need to restart the 'watch' process.

Brandon Arnold over 3 years ago

This is a know issue we're working on getting fixed in the next day or so.

Travis Fulton over 3 years ago

Excellent, thank you Brandon.

Jason Adams over 3 years ago

I am experiencing the same issues.

At first I thought I could rectify the issue by doing a massive overhaul of my workflow.

Specs before overhaul:
Windows 10 | Chrome Version 47.0.2526.111 m | node v0.12.7 | npm 2.11.3 | foundation-cli 2.0.2

I made sure to upgrade/uninstall everything as outlined in their respective documentation. After I set everything up and reinstalled the new Foundation CLI, I create a new project. Then I make a template utilizing the {{> header}} Handlebars syntax. I create an html file "header.html" in the /partials subdirectory. That file contains just the html necessary for my header.

I have the foundation cli running and watching my project. Browsersync shows that it updates, but the html from header.html is not compiled. I check the generated html source file to be sure and it does not show. Changes made to index.html occur immediately. Changes to header.html or the default.html template do not compile at all.

I was very excited to try Foundation 6 after developing with Foundation 5 for so long. I hope this issue can be fixed soon...

Specs after overhaul (** indicates a change):

Windows 10 | Chrome Version 47.0.2526.111 m | **node v5.4.1 | **npm 3.5.3 | foundation-cli 2.0.2

I've been working to fix this for over 4 hours now. The benefit of consolidating the workflow to just a foundation cli is a logical next step for Foundation, and using a leaner modular-based "partials" system that doesn't require a hulky CMS is very much welcome. But Panini is not compiling anything after the first or second change.

I am going to try and create a stand-alone Panini project and see if I can't replicate the issues. Then I guess I'll start digging into the Foundation source files for mistranslated Panini code...

Surely there must be more people having this issue?

Jason Adams over 3 years ago

Apparently there are internal issues with this involving Panini. This was brought up on Panini's github page as a comment from one of the developers today: https://github.com/zurb/panini/issues/10

Jason Adams over 3 years ago

User simonh1000 at github has come up with a stopgap solution so far. All credit goes to him: https://github.com/simonh1000

In your project folder, open the 'gulpfile.js' file.

Find the line:

gulp.task('pages', function() { 

add this line directly underneath, just before the return function:

 panini.refresh();

Then, toward the bottom of this file are all of the gulp tasks that initiate. You want to edit the watch for your layouts,partials from:

 gulp.watch(['src/{layouts,partials}/**/*.html'], ['pages:reset', 'reload']);

To this:

   gulp.watch(['src/{layouts,partials}/**/*.html'], function() {
  sequence([
        'pages',
        'reload'
        ]);
  });

This will effectively eliminate the need for the 'pages:reset' function defined early in the template, but I tried it today and it worked...

hector_sapien over 3 years ago

Confirmed, I've got this working too! :)

Jason Adams over 3 years ago

Alright, as referenced in another post on this forum, this issue has been fully addressed to the best of gulp 3's ability. Aside from a minor warning of a depricated 'run' call, not only does this fix address the load issue of partials, but it also deals with the race condition of reloading the browser prior to the parsing of changes AND adds a few other directories and files to the watchlist.

https://github.com/zurb/panini/issues/10

Although the fix I posted earlier today still works, the linked issue to github will have a link to updated javascript for the file I referenced earlier.

Thanks to all the users both here and github who managed to fix this issue in only a few hours of me asking about it!!

Rafi Benkual over 3 years ago

I think in 6.1.2, the ZURB stack now watches changes in the partials.

Jason Adams over 3 years ago

Yes, the linked changes I posted earlier were a final commit for this issue in 6.1.2