For the complete documentation index, see llms.txt. This page is also available as Markdown.

Recipes & known issues

Aurelia CLI Bundler + Docker

Issue: File watcher not detecting changes from host when running Aurelia CLI inside Docker containers.

Root Cause: Docker's file system layering can prevent proper file change notifications from reaching the container.

Solution:

  1. Modify File Watching to Use Polling:

    Update aurelia_project/tasks/watch.js (or watch.ts):

    // watch.js
    const gulp = require('gulp');
    const watch = require('gulp-watch');
    
    function watchPath(path, tasks) {
      return watch(path, { 
        usePolling: true,  // Enable polling for Docker
        interval: 1000     // Check every second
      }, gulp.series(tasks));
    }
    
    function watch() {
      return watchPath('src/**/*.{js,html,css}', 'build');
    }
    
    module.exports = {
      default: watch,
      watchPath
    };
  2. Alternative Docker Configuration:

    FROM node:14
    WORKDIR /app
    COPY package*.json ./
    RUN npm install
    COPY . .
    
    # Enable file watching with polling
    ENV CHOKIDAR_USEPOLLING=true
    ENV CHOKIDAR_INTERVAL=1000
    
    RUN au build --env prod
    CMD ["npm", "start"]
  3. Development Docker Compose:

    # docker-compose.yml
    version: '3.8'
    services:
      aurelia-app:
        build: .
        ports:
          - "8080:8080"
        volumes:
          - .:/app
          - /app/node_modules
        environment:
          - CHOKIDAR_USEPOLLING=true
        command: au run --watch

NPM Uninstalling Packages

Issue: Uninstalling a package without updating aurelia.json can lead to build errors.

Solution:

  1. Uninstall the Package:

  2. Remove from aurelia.json:

    • Delete any references in the dependencies array.

    • Update copyFiles if assets were previously copied.

Always verify dependency configurations after uninstalling packages.

NPM Version Compatibility Issues

Issue: NPM version 5.6.0 causes package installation problems and dependency resolution conflicts.

Symptoms:

  • Packages fail to install properly

  • Inconsistent dependency trees

  • Build failures after fresh installs

Solution:

  1. Upgrade NPM to 5.7.0 or Higher:

    or

  2. Clear NPM Cache:

  3. Reinstall Dependencies:

  4. Verify Installation:

Building with TFS (Team Foundation Server)

Primary Issue: TFS sets readonly attributes on checked-out files, causing build failures when the CLI tries to overwrite destination files.

Error Symptoms:

  • Build fails on second and subsequent attempts

  • "EACCES: permission denied" errors during build

  • Files cannot be overwritten in output directories

Solution:

  1. Modify Environment Configuration to Remove Read-Only Files:

    Update aurelia_project/environments/environment.js (or .ts):

  2. Update Build Task to Call Pre-build Cleanup:

    Modify aurelia_project/tasks/build.js:

  3. TFS Build Pipeline Configuration:

    Add these steps to your TFS build pipeline:

  4. Alternative: Use .tfignore Instead of .gitignore:

    Create .tfignore file (copy from .gitignore):

  5. Ensure Build Agent Configuration:

    • Install Node.js (v14+ recommended)

    • Install npm (v5.7.0+ to avoid known issues)

    • Configure sufficient disk space for node_modules

    • Set appropriate file system permissions

For Azure DevOps Server (formerly TFS) 2019+, consider migrating build pipelines to YAML format for better version control and portability.

For more detailed configurations and advanced usage, refer to the Aurelia CLI GitHub Repository.

Last updated

Was this helpful?