Get the Newsletter

Recipes & known issues

In this section you can find examples of particular setups, known issues and possible workarounds

Introduction

In this section you can find examples of particular setups, known issues and possible workarounds

Aurelia-CLI bundler + Docker

When using the Aurelia-CLI bundler together with Docker you might notice that the file watcher doesn't pick up changes that are made from the host.

In order to resolve this you can open aurelia_project/tasks/watch.js file (or watch.ts when using typescript) and modify the watchPath function to use polling:

    
  let watchPath = (p) => {
    gulpWatch(
      p,
      {
        read: false,
        verbose: true,
        usePolling: true
      },
      (vinyl) => processChange(vinyl));
  };
  
  

More information on this problem be found in this issue .

NPM uninstalling packages

If you're on NPM 5.6.0 (npm -v) then you might experience strange behavior when you're trying to install a package (using npm install). This should be resolved with version 5.7.0 of NPM.

Building with TFS

TFS sets readonly attribute on non checked out files. Depending on the selected environment corresponding file from aurelia_project/environments/ folder copied as src/environment.ts. On first build there is no such destination file, so build succeeds. As enviroment files usually are not checked out (no so much to edit), the destination file would also have readonly attribute. This lead to subsequent builds failure until the destination file either removed or readonly attribute unset. On sunsequent build readonly attribute will be set again.

In order to resolve this you can open aurelia_project/tasks/environment.js file (or environment.ts when using typescript) and add destination file removal code between rename and gulp.dest:

    
      // ...
      .pipe(rename(`environment${project.transpiler.fileExtension}`))
  
      // add this code to remove destination file first
      .pipe(through.obj(function (file, enc, cb) {
        fs.unlink(`${project.paths.root}/${file.relative}`, function() { cb(null, file); });
      }))
  
      .pipe(gulp.dest(project.paths.root))
      // ...
  
  

More information on this problem be found in this issue .

Also it would be wise to rename .gitignore to .tfignore.