lando / node

The Official Node Lando plugin.
https://docs.lando.dev/node
GNU General Public License v3.0
2 stars 2 forks source link

Gulp watch tasks will not trigger when editing local files in the watch directory #58

Open erichhaemmerle opened 8 months ago

erichhaemmerle commented 8 months ago

I am using Lando 3.18.0. I have created a Node (version 18) container in my .lando.yml file and set up some tooling so I can run node, npm, and gulp commands. This all works great and I can do things like "lando npm install" and "lando gulp" to run my default Gulp task and it all works great. The only thing that ISN'T working is if I have any kind of Gulp "watch" task. The task starts and it will say something like "Starting 'watchSass'...", but then it essentially just sits there. If I attempt to edit and save something in the watched directory, the watch task does not trigger and re-compile. If I run the same exact gulp file locally with my local Node and Gulp etc, it works fine, but if I attempt to do it with Lando, the watch task just doesn't want to trigger. Here is my .lando.yml file:

name: boilerplate
recipe: drupal10
config:
  php: "8.1"
  composer_version: "2.3.10"
  webroot: src/web
  database: mariadb:10.5
  drush: 11.4.0
  xdebug: false
env_file:
  - .env
services:
  appserver:
    build:
      - composer -d /app/src install
      - cp -n .lando/assets/settings.local.php src/web/sites/default/settings.local.php
    composer:
      behat/behat: "*"
    overrides:
      environment:
        DRUSH_OPTIONS_URI: "http://boilerplate.lndo.site"
        COMPOSER_PROCESS_TIMEOUT: 1800
  database:
    type: mariadb:10.5
    config:
      database: .lando/db.cnf
  node:
    type: node:18
    globals:
      gulp-cli: latest
    build:
      - cd src/web/themes/custom/uswds_base_subtheme && npm i && gulp updateUswds
tooling:
  behat:
    service: appserver
    description: Behat behavioral testing
  composer:
    service: appserver
    dir: /app/src
  drush:
    cmd: /app/src/vendor/bin/drush
  xdebug-on:
    service: appserver
    description: Enable xdebug for Apache.
    cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && docker-php-ext-enable xdebug && /etc/init.d/apache2 reload && echo "Xdebug enabled"
    user: root
  xdebug-off:
    service: appserver
    description: Disable xdebug for Apache.
    cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload && echo "Xdebug disabled"
    user: root
  npm:
    service: node
  node:
    service: node
  gulp:
    service: node
erichhaemmerle commented 7 months ago

So this might be a false alarm. I downgraded my Node version to 16 instead of 18, and now it looks like it is working. I'm not entirely sure why though.