javascriptember.jsember-clibroccolijs

ember build command fails with error: no such file or directory, lstat ..../ember-cli-test-loader/test-loader


I have recently updated the dependencies in packages.json and bower.json and have run into a similar error like this that i solved by providing an overwrite to the vendorFiles option in my EmberApp:

## ember-cli-build.js
...
module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    vendorFiles: {
      'ember-resolver.js': [
        'bower_components/ember-resolver/index.js' , { //similar error to below was solved like this
          exports: {
            'ember/resolver': ['default']
          }
        }
      ],
      ...
    }
  });
  ...

I have tried a similar solution where I place this code in the vendorFiles property to no good luck :( :

#ember-cli-build.js

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    vendorFiles: {
      'ember-resolver.js': <...>,
      // \/\/\/\/\/\/\/\/\/
      'ember-cli-test-loader': [
        'bower_components/ember-cli-test-loader/index.js', {
          exports: {
            'ember/test-loader': ['default']
          }
        }
      ]
      // /\/\/\/\/\/\/\/\/\
    }
  });

Full output as follows:

ENOENT: no such file or directory, lstat '<...>/my-app/tmp/funnel-input_base_path-qUHHutHN.tmp/0/bower_components/ember-cli-test-loader/test-loader.js'
Error: ENOENT: no such file or directory, lstat '<...>/my-app/tmp/funnel-input_base_path-qUHHutHN.tmp/0/bower_components/ember-cli-test-loader/test-loader.js'
    at Error (native)
    at Object.fs.lstatSync (fs.js:839:18)
    at symlink (<...>/my-app/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:63:26)
    at Function.symlinkOrCopySync [as sync] (<...>/my-app/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
    at Funnel._copy (<...>/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:398:19)
    at Funnel.processFile (<...>/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:381:8)
    at Funnel.applyPatch [as _applyPatch] (<...>/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:298:12)
    at Funnel.<anonymous> (<...>/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:250:10)
    at Array.forEach (native)
    at Funnel.processFilters (<...>/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:249:9)

I'm not sure from the output where i would find out what is happening. I'm new to broccoli (coming from grunt and gulp) and also new to ember-cli


Solution

  • I Believe I've answered my own question:

    The version of test-loader I have is 1.0.0. When i looked at the actual files, the index.js is quite bare. I don't know why the owner of this library tagged it as 1.0.0 as it does not do much... (well I suppose it is a "breaking change" technically speaking)

    Anyway, I reverted my version to 0.1.3 and it seems to work now. Also i had to get rid of the test-loader portion in my vendorFiles option as i no longer needed it.

    Thanks for considering my question!