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:
Modify File Watching to Use Polling:
Update
aurelia_project/tasks/watch.js(orwatch.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 };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"]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:
Uninstall the Package:
Remove from
aurelia.json:Delete any references in the
dependenciesarray.Update
copyFilesif assets were previously copied.
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:
Upgrade NPM to 5.7.0 or Higher:
or
Clear NPM Cache:
Reinstall Dependencies:
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:
Modify Environment Configuration to Remove Read-Only Files:
Update
aurelia_project/environments/environment.js(or.ts):Update Build Task to Call Pre-build Cleanup:
Modify
aurelia_project/tasks/build.js:TFS Build Pipeline Configuration:
Add these steps to your TFS build pipeline:
Alternative: Use .tfignore Instead of .gitignore:
Create
.tfignorefile (copy from.gitignore):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
Last updated
Was this helpful?